Arduino Programmierung über einen Raspberry Pi
X über ssh
auf dem raspi arduino installieren
aus der Ferne mittels ssh -X arduino starten
per Kommandozeile mittels ino
Für die meisten Fälle ist die Arduino IDE übertrieben. Ino erfüllt den selben Zweck per Kommandozeile.
ino mittels pip installieren + picocom als seriellen Monitor:
aptitude install python-pip picocom pip install ino
kleines testprojekt anlegen, kompilieren und auf arduino laden:
mkdir test cd test ino init vi src/sketch.ino ino build -m mega2560 ino upload -m mega2560
unterstützte Arduino Boards auflisten (für -m ...):
ino list-models
bsp sketch.ino:
/* For Loop Iteration Demonstrates the use of a for() loop. Lights multiple LEDs in sequence, then in reverse. The circuit: * LEDs from pins 2 through 7 to ground created 2006 by David A. Mellis modified 30 Aug 2011 by Tom Igoe This example code is in the public domain. http://www.arduino.cc/en/Tutorial/ForLoop */ int timer = 100; // The higher the number, the slower the timing. int pin_min = 2; int pin_max = 9; void setup() { // use a for loop to initialize each pin as an output: for (int thisPin = pin_min; thisPin <= pin_max; thisPin++) { pinMode(thisPin, OUTPUT); } } void loop() { // loop from the lowest pin to the highest: for (int thisPin = 2; thisPin <= pin_max; thisPin++) { // turn the pin on: digitalWrite(thisPin, HIGH); delay(timer); // turn the pin off: digitalWrite(thisPin, LOW); } // loop from the highest pin to the lowest: for (int thisPin = pin_max; thisPin >= pin_min; thisPin--) { // turn the pin on: digitalWrite(thisPin, HIGH); delay(timer); // turn the pin off: digitalWrite(thisPin, LOW); } }
mit dem Arduino direkt kommunizieren:
ino serial