![]() | arduino-bare-metal-blinkArduino blink example without IDE or additional libraries |
Very simple program to blink the built-in led of an arduino (UNO/Nano, not
tested with other boards) without using any external libraries, only one C file
main.c
avr-gcc and avr-libc to compile the codeavrdude for uploading the program to the microcontrollerHaving 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*, however it appears it should
match the ARDUINO_PORT variable on Makefile. Finally upload the code to the
arduino with
$ make upload