Skip to content

mytwocentimes/fhnw-iot-work-02

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 

Repository files navigation

IoT Engineering

Hands-on of lesson 2

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.

a) LED (digital output), 5'

  • nRF52840 or ESP8266 w/ Grove:
  • Connect to adapter port D2.
  • Maps to ESP8266 pin 2.
  • Or nRF52840 pin 5.
  • Adapt this code.

b) Button (digital input), 5'

  • nRF52840 or ESP8266 w/ Grove:
  • Connect to adapter port D2.
  • Maps to ESP8266 pin 2.
  • Or nRF52840 pin 5.
  • Adapt this code.

c) Button-triggered LED, 15'

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

d) State machine, 5'

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

e) Sensing light (analog input), 5'

  • nRF52840 or ESP8266 w/ Grove:
  • Connect to adapter port A0.
  • Maps to ESP8266 pin ADC.
  • Or nRF52840 pin A0.
  • Adapt this code.

f) Temperature (DHT11), 5'

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

g) Kitchen timer, 30'

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

h) Homework, max. 3h

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

Submitting results

Tools

Git

On your computer

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

Wiki

Support

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published