User Tools

Site Tools


documentation:fa20:programarduinounoinc

This is an old revision of the document!


Program Arduino Uno in C

test

Windows

install win avr: https://sourceforge.net/projects/winavr/

open a terminal window: ⊞ Win + C M D

put these files in a folder “path/to/folder/c-blink”, and run: \

''cd path/to/folder/c-blink make make flash''

c-blink.zip

The important bit is you Makefile. Depending on your configuration you might have to adjust the name of the USB-port your Arduino is connected to:

''AVRDUDE = avrdude -q -V -p atmega328p -C C:\WinAVR-20100110\bin\avrdude.conf -D -c arduino -b 115200 -P COM6''

Mac/Linux

For Mac install crosspack-avr:

For Linux install avrgcc toolchain:

  • sudo apt install avrdude gcc-avr avr-libc make

open terminal/bash:

  • Mac: cmd-space and then type terminal
  • Linux: usually Ctrl+Alt+T

put the files (download below) in a folder path/to/folder/c-blink

open the Makefile with a text editor and edit the following line:

"AVRDUDE = avrdude -q -V -p atmega328p -C /usr/local/CrossPack-AVR/etc/avrdude.conf -D -c arduino -b 115200 -P /dev/cu.usbmodem14101"''

changing:

/dev/cu.usbmodem14101** 

with the serial port where the Arduino is connected to, you can get it from the Arduino IDE Tools→Port, or via bash with

ll /dev/ | grep cu.usbmodem
/usr/local/CrossPack-AVR/etc/avrdude.conf

with the folder where you have installed the AVR Crosspack/Toolchain, if different save the Makefile and then run: <code> cd path/to/folder/c-blink make clean make make flash </code> c-blink_mac_linux.zip''

documentation/fa20/programarduinounoinc.1610555327.txt.gz · Last modified: 2021/01/13 16:28 by ferdi