A Timer Example – Blinking a LED
A blinking LED is the “hello world” of embedded systems, and is also a great example of how to use the Timer.
The Inefficient Way
The “hello world” programs are usually the first ones that we write, so of course need to be simple. Usually the LED is blinked using a delay loop, as it’s the quickest easiest way to get that first project flashing at you. They’re also very inefficient, as the CPU is using all its energy counting out the delay. The below is a typical example: