PROGRAMMING ADVANCED FEEDBACK WITH ARDUINO Part 05 - Led fade and - - PowerPoint PPT Presentation

programming advanced feedback with arduino
SMART_READER_LITE
LIVE PREVIEW

PROGRAMMING ADVANCED FEEDBACK WITH ARDUINO Part 05 - Led fade and - - PowerPoint PPT Presentation

Part 05 - Led fade and change color asynchronously PROGRAMMING ADVANCED FEEDBACK WITH ARDUINO Part 05 - Led fade and change color asynchronously Blocking vs non blocking: _BLOCKING_ Brightness loop() loop() loop() time _ NON


slide-1
SLIDE 1

PROGRAMMING 
 ADVANCED FEEDBACK
 WITH ARDUINO

Part 05 - Led fade and change color asynchronously

slide-2
SLIDE 2

Part 05 - Led fade and change color asynchronously

Blocking vs non blocking:

loop() loop() loop() Brightness time _BLOCKING_

loop()

Brightness time _ NON BLOCKING_

loop() loop() loop() loop() loop() loop() loop() loop() loop() loop() loop() loop() loop() loop() loop() loop() loop() loop() loop() loop() loop() loop() loop() loop() loop() loop() loop() loop() loop() loop() loop() loop() loop() loop() loop() loop() loop() loop() loop() loop()

😓 🤘

slide-3
SLIDE 3

Keep track of time without delay()

Part 05 - Led fade and change color asynchronously

millis()

The amount of milliseconds that has passed since last time we reboot the board

slide-4
SLIDE 4

Keep track of time without delay()

time

update interval millis() / current time last update time

if ((current time - last update time) > update interval{ THE INTERVAL HAS PASSED!!! DO YOUR THING HERE }

Part 05 - Led fade and change color asynchronously

slide-5
SLIDE 5

Can you design and code a new animation without using delay? OPTIONS:

1) blink. 2) color fade between colors. 3) blink with irregular intervals. 4) BE CREATIVE! :)

CHALLENGE 5:

Part 05 - Led fade and change color asynchronously