For slides and example code, see lesson 2
Note: Do not work on this repository right away.
Create your personal copy by clicking this GitHub Classroom link.
- nRF52840 or ESP8266 w/ Grove:
- Connect to adapter port D2.
- Maps to ESP8266 pin 2.
- Or nRF52840 pin 5.
- Adapt this code.
- nRF52840 or ESP8266 w/ Grove:
- Connect to adapter port D2.
- Maps to ESP8266 pin 2.
- Or nRF52840 pin 5.
- Adapt this code.
- This works with nRF52840 or ESP8266, w/ Grove.
- Connect the LED to port D2, and the button to D4.
- Combine the previous examples to switch the LED.
- Look up the pin mapping to adapt the pin numbers.
- Copy and complete the code of the state machine.
- Make sure it works, with a button and LED setup.
- Change it to switch off only, if the 2nd press is long.
- Let's define long as > 1s, measure time with millis()
- nRF52840 or ESP8266 w/ Grove:
- Connect to adapter port A0.
- Maps to ESP8266 pin ADC.
- Or nRF52840 pin A0.
- Adapt this code.
- DHT11 sensors require a library.
- Connect to adapter port D2.
- Maps to ESP8266 pin 2.
- Or nRF52840 pin 5.
- Adapt this code.
- New to libraries? See Arduino Wiki page.
- Design a kitchen timer to the following specification:
- Displays a countdown to 0, in minutes and seconds.
- Let's the user reset to 00:00, enter a new timespan.
- Allows the user to start the countdown at mm:ss.
- Starts buzzing if the countdown reaches 00:00.
- Use a state machine, get the time with millis().
- Implement or finish the kitchen timer you designed.
- Document the timer state machine (PDF or PNG).
- Commit the code and docs to the hands-on repo.
- Bring the (working) timer to the next lesson.
- Commit and push local changes to your repository.
- Want a review? Create an issue, mention me (@tamberg).
On your computer
- In the hands-on repository fork for your class, in README.md, click the GitHub Classroom link.
- Once you accept the assessment, you get a personal, private repository URL for your USER_NAME:
http://github.com/fhnw-iot-CLASS/fhnw-iot-work-02-USER_NAME
On your computer or Raspberry Pi
- Clone the repository
$ cd ~ $ git clone REPO_URL
- Add a file
$ git add FILE
- Commit changes
$ git commit FILE -m "Fixed all bugs"
- Push changes
$ git push