This is a simple program that implements a task scheduler. It executes a series of tasks attached to the scheduler after their specified task period (in milliseconds) has passed.
In the example, four leds are controlled: two blink at different rates, and the other two controlled by buttons.
avr-gcc
andavr-libc
to compile the codeavrdude
for uploading the program to the microcontroller
Having the dependencies installed, compile the code running make
or:
$ make compile
Then with the board connected to the computer, check the port with:
$ ls /dev/tty*
Often appears as /dev/ttyUSB*
or /dev/ttyACM*
, by default /dev/ttyUSB0
is
used, to override this execute make asigning the corret port to the PORT
shell variable, for example:
$ PORT=/dev/ttyUSB1 make upload