Skip to content

Latest commit

 

History

History
32 lines (27 loc) · 1.53 KB

README.md

File metadata and controls

32 lines (27 loc) · 1.53 KB

IoT Engineering

Hands-on of lesson 2

For slides and example code, see lesson 2

Note: Do not work on this repository right away.
Check existing forks to find the specific repository for your class.

a) Button-triggered LED, 15'

  • Connect the LED to port D2*, and the button to D4.
  • Combine the previous examples to switch the LED.
  • *On the ESP8266, remove LED for programming.
  • Look up the pin mapping to adapt the pin numbers.

b) State machine, 15'

  • 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()

c) Kitchen timer, 15'

  • 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().

d) Challenge

  • Build and implement the kitchen timer you designed.
  • Document the timer state machine (ASCII or image).
  • Commit the code and docs to the hands-on repo.
  • Bring the (working) timer to the next lesson.