Education and Teaching
(Read 6496 times)
Jun 12, 2014, 05:32 pm
These videos really helped me when I started programming for the Arduino:
(At the bottom you can click on "older posts" until you reach the first video of the tutorial).
Electronic Technician, Electronic Engineering Technician I love to build things. Test equipment, replica and original sci fi props and costume pieces, and whatever else I feel like at the time. I have an Ultimaker and a 3D engraver.
Jun 13, 2014, 05:08 pm
As someone also learning to program the Arduino, I have a pet peeve.... the overuse of delay()!
Almost every book, website, and video series I've examined starts with the Blink sketch that uses delay() to time events, and never really goes past it. Even though the example sketches that come with the Arduino quickly move to a different style of programming (see Blink Without Delay and Debounce, which use the millis() timer), those books, websites, and videos keep using delay() instead.
It is simpler - but then using your emergency brake to control your car's speed is simpler than using the brake, gas, and shifter. And I think using delay() is akin to using your emergency brake to drive.
Study Blink Without Delay and Debounce, to start. Find videos about those sketches, and about using the millis() and micros() timers to time events.
And if a book, website, or video tells you to use delay() to debounce a button, stop reading or watching. That is a poor way to accomplish debouncing an input, it stops the action so nothing else can happen, and there are much better ways to do this.
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8
gammon.com.au/blink - gammon.com.au/serial - gammon.com.au/interrupts