![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVTxd7aBHw8-z2bIZFFHitNFboz7tJO-hQRIBToySEoNsUegcmeX4XwG8CKFt50jGjnR0lu8rGkQItD1MOWhEMs8slWqn_6IqcS2DRxs1R8JAkVSYoz-88eXMFqvI3Xgm8xcfYPAjYv3a7/s1600/arduino_plus_raspberry_pi_cropped.jpg)
$ 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
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTNaNlBP-aiiEImjxw4n3wnk5Ftz8z-GfpMhORZ27Si3tZTgGSZlSy6DUEow3zqJcBwoR5DOEsM-EYFELxVGYT_rK6juncF26sLrd5yqw5RC8ekUOf73GBI1kE1wTVllcvZ1ftYWHg0SHc/s1600/raspberry-pi-to-arduino-via-usb-cable.jpg)
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