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 BLOCKING_ 🤘 Brightness 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() loop() time
Part 05 - Led fade and change color asynchronously Keep track of time without delay() millis() The amount of milliseconds that has passed since last time we reboot the board
Part 05 - Led fade and change color asynchronously Keep track of time without delay() update interval millis() / current time last update time 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 CHALLENGE 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! :)
Recommend
More recommend