Unterschiede zwischen den Revisionen 1 und 2
Revision 1 vom 2014-12-11 13:11:17
Größe: 1758
Autor: anonym
Kommentar:
Revision 2 vom 2014-12-11 13:15:33
Größe: 1843
Autor: anonym
Kommentar:
Gelöschter Text ist auf diese Art markiert. Hinzugefügter Text ist auf diese Art markiert.
Zeile 21: Zeile 21:
}}}
  * unterstützte Arduino Boards auflisten (für -m ...): {{{
ino list-models

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 mittels pip installieren

    • aptitude install python-pip
      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);
        }
      }

Arduino (zuletzt geändert am 2014-12-11 13:42:03 durch anonym)


Creative Commons Lizenzvertrag
This page is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.