Arduino Bare Metal Blink Example
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
Dependencies
avr-gccandavr-libcto compile the codeavrdudefor uploading the program to the microcontroller
Compile and upload to the board
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*, however it appears it should
match the ARDUINO_PORT variable on Makefile. Finally upload the code to the
arduino with
$ make upload
1 # Arduino Bare Metal Blink Example 2 3 Very simple program to blink the built-in led of an arduino (UNO/Nano, not 4 tested with other boards) without using any external libraries, only one C file 5 `main.c` 6 7 ## Dependencies 8 9 * `avr-gcc` and `avr-libc` to compile the code 10 * `avrdude` for uploading the program to the microcontroller 11 12 ## Compile and upload to the board 13 14 Having the dependencies installed, compile the code running `make` or: 15 16 ```console 17 $ make compile 18 ``` 19 20 Then with the board connected to the computer, check the port with: 21 22 ```console 23 $ ls /dev/tty* 24 ``` 25 26 Often appears as `/dev/ttyUSB*` or `/dev/ttyACM*`, however it appears it should 27 match the `ARDUINO_PORT` variable on `Makefile`. Finally upload the code to the 28 arduino with 29 30 ```console 31 $ make upload 32 ```
