
$ sudo apt-get install arduino-mk
To check if it works fine you can copy one of examples:
$ cp -r /usr/share/arduino/examples/01.Basics/Blink/ ~
$ cd Blink

sudo dmesg -c
Second time you run it you will see something like:
FTDI USB Serial Device converter now attached to ttyUSB0
Which means that your arduino is connected as /dev/ttyUSB0. And then create Makefile in project folder:
$ vim Makefile
In my case it looks like the following one:
ARDUINO_DIR = /usr/share/arduino
TARGET = Blink
ARDUINO_LIBS =
MCU = atmega328p
F_CPU = 16000000
ARDUINO_PORT = /dev/ttyUSB0
AVRDUDE_ARD_BAUDRATE = 57600
AVRDUDE_ARD_PROGRAMMER = arduino
include /usr/share/arduino/Arduino.mk
If you are not sure which MCU to choose, take a look at the file /usr/share/arduino/hardware/arduino/boards.txt.
After that you can run:
$ make upload
Which will compile your sketch and upload it onto controller.
Keine Kommentare:
Kommentar veröffentlichen