parent
9e7cc89b96
commit
c38636e8aa
@ -0,0 +1,5 @@
|
||||
.pio
|
||||
.vscode/.browse.c_cpp.db*
|
||||
.vscode/c_cpp_properties.json
|
||||
.vscode/launch.json
|
||||
.vscode/ipch
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
||||
// for the documentation about the extensions.json format
|
||||
"recommendations": [
|
||||
"platformio.platformio-ide"
|
||||
]
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
|
||||
This directory is intended for project header files.
|
||||
|
||||
A header file is a file containing C declarations and macro definitions
|
||||
to be shared between several project source files. You request the use of a
|
||||
header file in your project source file (C, C++, etc) located in `src` folder
|
||||
by including it, with the C preprocessing directive `#include'.
|
||||
|
||||
```src/main.c
|
||||
|
||||
#include "header.h"
|
||||
|
||||
int main (void)
|
||||
{
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
Including a header file produces the same results as copying the header file
|
||||
into each source file that needs it. Such copying would be time-consuming
|
||||
and error-prone. With a header file, the related declarations appear
|
||||
in only one place. If they need to be changed, they can be changed in one
|
||||
place, and programs that include the header file will automatically use the
|
||||
new version when next recompiled. The header file eliminates the labor of
|
||||
finding and changing all the copies as well as the risk that a failure to
|
||||
find one copy will result in inconsistencies within a program.
|
||||
|
||||
In C, the usual convention is to give header files names that end with `.h'.
|
||||
It is most portable to use only letters, digits, dashes, and underscores in
|
||||
header file names, and at most one dot.
|
||||
|
||||
Read more about using header files in official GCC documentation:
|
||||
|
||||
* Include Syntax
|
||||
* Include Operation
|
||||
* Once-Only Headers
|
||||
* Computed Includes
|
||||
|
||||
https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html
|
@ -0,0 +1,46 @@
|
||||
|
||||
This directory is intended for project specific (private) libraries.
|
||||
PlatformIO will compile them to static libraries and link into executable file.
|
||||
|
||||
The source code of each library should be placed in a an own separate directory
|
||||
("lib/your_library_name/[here are source files]").
|
||||
|
||||
For example, see a structure of the following two libraries `Foo` and `Bar`:
|
||||
|
||||
|--lib
|
||||
| |
|
||||
| |--Bar
|
||||
| | |--docs
|
||||
| | |--examples
|
||||
| | |--src
|
||||
| | |- Bar.c
|
||||
| | |- Bar.h
|
||||
| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html
|
||||
| |
|
||||
| |--Foo
|
||||
| | |- Foo.c
|
||||
| | |- Foo.h
|
||||
| |
|
||||
| |- README --> THIS FILE
|
||||
|
|
||||
|- platformio.ini
|
||||
|--src
|
||||
|- main.c
|
||||
|
||||
and a contents of `src/main.c`:
|
||||
```
|
||||
#include <Foo.h>
|
||||
#include <Bar.h>
|
||||
|
||||
int main (void)
|
||||
{
|
||||
...
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
PlatformIO Library Dependency Finder will find automatically dependent
|
||||
libraries scanning project source files.
|
||||
|
||||
More information about PlatformIO Library Dependency Finder
|
||||
- https://docs.platformio.org/page/librarymanager/ldf.html
|
@ -0,0 +1,16 @@
|
||||
; PlatformIO Project Configuration File
|
||||
;
|
||||
; Build options: build flags, source filter
|
||||
; Upload options: custom upload port, speed and extra flags
|
||||
; Library options: dependencies, extra library storages
|
||||
; Advanced options: extra scripting
|
||||
;
|
||||
; Please visit documentation for the other options and examples
|
||||
; https://docs.platformio.org/page/projectconf.html
|
||||
|
||||
[env:seeed_wio_terminal]
|
||||
platform = atmelsam
|
||||
board = seeed_wio_terminal
|
||||
framework = arduino
|
||||
lib_deps =
|
||||
seeed-studio/Grove Ranging sensor - VL53L0X @ ^1.1.1
|
@ -0,0 +1,31 @@
|
||||
#include <Arduino.h>
|
||||
#include "Seeed_vl53l0x.h"
|
||||
|
||||
Seeed_vl53l0x VL53L0X;
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(9600);
|
||||
|
||||
while (!Serial)
|
||||
; // Wait for Serial to be ready
|
||||
|
||||
delay(1000);
|
||||
|
||||
VL53L0X.VL53L0X_common_init();
|
||||
VL53L0X.VL53L0X_high_accuracy_ranging_init();
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
VL53L0X_RangingMeasurementData_t RangingMeasurementData;
|
||||
memset(&RangingMeasurementData, 0, sizeof(VL53L0X_RangingMeasurementData_t));
|
||||
|
||||
VL53L0X.PerformSingleRangingMeasurement(&RangingMeasurementData);
|
||||
|
||||
Serial.print("Distance = ");
|
||||
Serial.print(RangingMeasurementData.RangeMilliMeter);
|
||||
Serial.println(" mm");
|
||||
|
||||
delay(1000);
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
|
||||
This directory is intended for PlatformIO Unit Testing and project tests.
|
||||
|
||||
Unit Testing is a software testing method by which individual units of
|
||||
source code, sets of one or more MCU program modules together with associated
|
||||
control data, usage procedures, and operating procedures, are tested to
|
||||
determine whether they are fit for use. Unit testing finds problems early
|
||||
in the development cycle.
|
||||
|
||||
More information about PlatformIO Unit Testing:
|
||||
- https://docs.platformio.org/page/plus/unit-testing.html
|
@ -1,5 +1,20 @@
|
||||
# Consumer IoT - build a smart voice assistant
|
||||
|
||||
The fod has been grown, driven to a processing plant, sorted for quality, sold in the store and now it's time to cook! One of the core pieces of any kitchen is a timer. Initially these started as simple hour glasses - your food was cooked when all the sand trickled down into the bottom bulb. They then went clockwork, then electric.
|
||||
|
||||
The latest iterations are now part of our smart devices. In kitchens all throughout the world you'll head chefs shouting "Hey Siri - set a 10 minute timer", or "Alexa - cancel my bread timer". No longer do you have to walk back to the kitchen to check on a timer, you can do it from your phone, or a call out across the room.
|
||||
|
||||
In these 4 lessons you'll learn how to build a smart timer, using AI to recognize your voice, understand what you are asking for, and reply with information about your timer. You'll also add support for multiple languages.
|
||||
|
||||
> 💁 These lessons will use some cloud resources. If you don't complete all the lessons in this project, make sure you [Clean up your project](../clean-up.md).
|
||||
|
||||
## Topics
|
||||
|
||||
1. [Recognize speech with an IoT device](./lessons/1-speech-recognition/README.md)
|
||||
1. [Understand language](./lessons/2-language-understanding/README.md)
|
||||
1. [Provide spoken feedback](./lessons/3-spoken-feedback/README.md)
|
||||
1. [Support multiple languages](./lessons/4-multiple-language-support/README.md)
|
||||
|
||||
## Credits
|
||||
|
||||
All the lessons were written with ♥️ by [Jim Bennett](https://GitHub.com/JimBobBennett)
|
||||
|
@ -0,0 +1,33 @@
|
||||
# Recognize speech with an IoT device
|
||||
|
||||
Add a sketchnote if possible/appropriate
|
||||
|
||||

|
||||
|
||||
## Pre-lecture quiz
|
||||
|
||||
[Pre-lecture quiz](https://brave-island-0b7c7f50f.azurestaticapps.net/quiz/33)
|
||||
|
||||
## Introduction
|
||||
|
||||
In this lesson you will learn about
|
||||
|
||||
In this lesson we'll cover:
|
||||
|
||||
* [Thing 1](#thing-1)
|
||||
|
||||
## Thing 1
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Challenge
|
||||
|
||||
## Post-lecture quiz
|
||||
|
||||
[Post-lecture quiz](https://brave-island-0b7c7f50f.azurestaticapps.net/quiz/34)
|
||||
|
||||
## Review & Self Study
|
||||
|
||||
## Assignment
|
||||
|
||||
[](assignment.md)
|
@ -0,0 +1,9 @@
|
||||
#
|
||||
|
||||
## Instructions
|
||||
|
||||
## Rubric
|
||||
|
||||
| Criteria | Exemplary | Adequate | Needs Improvement |
|
||||
| -------- | --------- | -------- | ----------------- |
|
||||
| | | | |
|
@ -0,0 +1,36 @@
|
||||
## find devices
|
||||
|
||||
aplay -l
|
||||
|
||||
arecord -l
|
||||
|
||||
## configure defaults
|
||||
|
||||
sudo nano /usr/share/alsa/alsa.conf
|
||||
|
||||
defaults.pcm.card 1
|
||||
|
||||
speaker-test -t wav -c 2
|
||||
|
||||
## test
|
||||
|
||||
arecord --format=S16_LE --duration=5 --rate=16000 --file-type=raw out.raw
|
||||
aplay --format=S16_LE --rate=16000 out.raw
|
||||
|
||||
## Create service
|
||||
|
||||
az group create --name smart-timer --location westus2
|
||||
|
||||
az cognitiveservices account create \
|
||||
--name smart-timer \
|
||||
--resource-group smart-timer \
|
||||
--kind SpeechServices \
|
||||
--sku F0 \
|
||||
--location westus2 \
|
||||
--yes
|
||||
|
||||
copy endpoint for token issuer
|
||||
|
||||
az cognitiveservices account keys list \
|
||||
--name smart-timer \
|
||||
--resource-group smart-timer
|
@ -0,0 +1,5 @@
|
||||
## capture audio
|
||||
|
||||
sudo apt-get install libportaudio0 libportaudio2 libportaudiocpp0 portaudio19-dev
|
||||
|
||||
pip3 install pyaudio
|
@ -0,0 +1,33 @@
|
||||
# Understand language
|
||||
|
||||
Add a sketchnote if possible/appropriate
|
||||
|
||||

|
||||
|
||||
## Pre-lecture quiz
|
||||
|
||||
[Pre-lecture quiz](https://brave-island-0b7c7f50f.azurestaticapps.net/quiz/33)
|
||||
|
||||
## Introduction
|
||||
|
||||
In this lesson you will learn about
|
||||
|
||||
In this lesson we'll cover:
|
||||
|
||||
* [Thing 1](#thing-1)
|
||||
|
||||
## Thing 1
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Challenge
|
||||
|
||||
## Post-lecture quiz
|
||||
|
||||
[Post-lecture quiz](https://brave-island-0b7c7f50f.azurestaticapps.net/quiz/34)
|
||||
|
||||
## Review & Self Study
|
||||
|
||||
## Assignment
|
||||
|
||||
[](assignment.md)
|
@ -0,0 +1,9 @@
|
||||
#
|
||||
|
||||
## Instructions
|
||||
|
||||
## Rubric
|
||||
|
||||
| Criteria | Exemplary | Adequate | Needs Improvement |
|
||||
| -------- | --------- | -------- | ----------------- |
|
||||
| | | | |
|
@ -0,0 +1,33 @@
|
||||
# Provide spoken feedback
|
||||
|
||||
Add a sketchnote if possible/appropriate
|
||||
|
||||

|
||||
|
||||
## Pre-lecture quiz
|
||||
|
||||
[Pre-lecture quiz](https://brave-island-0b7c7f50f.azurestaticapps.net/quiz/33)
|
||||
|
||||
## Introduction
|
||||
|
||||
In this lesson you will learn about
|
||||
|
||||
In this lesson we'll cover:
|
||||
|
||||
* [Thing 1](#thing-1)
|
||||
|
||||
## Thing 1
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Challenge
|
||||
|
||||
## Post-lecture quiz
|
||||
|
||||
[Post-lecture quiz](https://brave-island-0b7c7f50f.azurestaticapps.net/quiz/34)
|
||||
|
||||
## Review & Self Study
|
||||
|
||||
## Assignment
|
||||
|
||||
[](assignment.md)
|
@ -0,0 +1,9 @@
|
||||
#
|
||||
|
||||
## Instructions
|
||||
|
||||
## Rubric
|
||||
|
||||
| Criteria | Exemplary | Adequate | Needs Improvement |
|
||||
| -------- | --------- | -------- | ----------------- |
|
||||
| | | | |
|
@ -0,0 +1,33 @@
|
||||
# Support multiple languages
|
||||
|
||||
Add a sketchnote if possible/appropriate
|
||||
|
||||

|
||||
|
||||
## Pre-lecture quiz
|
||||
|
||||
[Pre-lecture quiz](https://brave-island-0b7c7f50f.azurestaticapps.net/quiz/33)
|
||||
|
||||
## Introduction
|
||||
|
||||
In this lesson you will learn about
|
||||
|
||||
In this lesson we'll cover:
|
||||
|
||||
* [Thing 1](#thing-1)
|
||||
|
||||
## Thing 1
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Challenge
|
||||
|
||||
## Post-lecture quiz
|
||||
|
||||
[Post-lecture quiz](https://brave-island-0b7c7f50f.azurestaticapps.net/quiz/34)
|
||||
|
||||
## Review & Self Study
|
||||
|
||||
## Assignment
|
||||
|
||||
[](assignment.md)
|
@ -0,0 +1,9 @@
|
||||
#
|
||||
|
||||
## Instructions
|
||||
|
||||
## Rubric
|
||||
|
||||
| Criteria | Exemplary | Adequate | Needs Improvement |
|
||||
| -------- | --------- | -------- | ----------------- |
|
||||
| | | | |
|
Loading…
Reference in new issue