Home > Technologie > Wie zur Steuerung 12 led mit Uno

Wie zur Steuerung 12 led mit Uno

0
Advertisement

Wie zur Steuerung 12 led mit Uno

Dies ist mein erstes belehrbares und ich möchte Oadil für seine instructable Trafik Licht danken, 9 führte mit Arduino UNO Ich kaufte einen einfachen UNO Mikrocontroller und ich war auf der Suche für ein einfaches Projekt in der Lage, die Eingänge und die Ausgänge zu verstehen. Schauen Sie sich seine Anweisung in der Lage, die ersten Schritte zu sehen und wie die LED mit den verschiedenen Ausgängen zu verbinden. Ich könnte nur seinen Text kopieren, aber ich möchte ihm etwas Gutes tun. Ich verbrachte einige Tage, bevor ich Hilfe fand.

Schritt 1: Trafik leuchtet

Int led2 = 2;

Int led3 = 3; Int del = 1000; Int led4 = 4; Int led5 = 5; Int led6 = 6; Int led7 = 7; Int led8 = 8; Int led9 = 9; Int led10 = 10;

// Die Setup-Routine läuft einmal, wenn Sie Reset:

Void setup () {// Initialisieren Sie den digitalen Pin als Oupput.

PinMode (led2, OUTPUT); PinMode (led3, AUSGANG); PinMode (led4, AUSGANG); PinMode (led5, AUSGANG); PinMode (led6, AUSGANG); PinMode (led7, AUSGANG); PinMode (led8, AUSGANG); PinMode (led9, AUSGANG); PinMode (led10, AUSGANG); } // Die Schleifenroutine läuft immer und immer wieder:

Void Schleife () {

DigitalWrite (led2, HIGH); DigitalWrite (led3, LOW); DigitalWrite (led4, LOW); DigitalWrite (led5, LOW); DigitalWrite (led6, LOW); DigitalWrite (led7, LOW); DigitalWrite (led8, HIGH); DigitalWrite (led9, LOW); DigitalWrite (led10, LOW);

//Alles rot

DigitalWrite (led2, LOW); DigitalWrite (led3, LOW); DigitalWrite (led4, HIGH); DigitalWrite (led5, HIGH); DigitalWrite (led6, LOW); DigitalWrite (led7, LOW); DigitalWrite (led8, HIGH); DigitalWrite (led9, LOW); DigitalWrite (led10, LOW);

Verzögerung (del * 2);

// GREEN1

DigitalWrite (led2, LOW); DigitalWrite (led3, HIGH); DigitalWrite (led4, LOW); DigitalWrite (led5, HIGH); DigitalWrite (led6, LOW); DigitalWrite (led7, LOW); DigitalWrite (led8, HIGH); DigitalWrite (led9, LOW); DigitalWrite (led10, LOW);

Verzögerung (del);

// GELB1

DigitalWrite (led2, HIGH); DigitalWrite (led3, LOW); DigitalWrite (led4, LOW); DigitalWrite (led5, HIGH); DigitalWrite (led6, LOW); DigitalWrite (led7, LOW); DigitalWrite (led8, HIGH); DigitalWrite (led9, LOW); DigitalWrite (led10, LOW);

Verzögerung (del / 2);

//ALLES ROT

DigitalWrite (led2, HIGH); DigitalWrite (led3, LOW); DigitalWrite (led4, LOW); DigitalWrite (led5, LOW); DigitalWrite (led6, LOW); DigitalWrite (led7, HIGH); DigitalWrite (led8, HIGH); DigitalWrite (led9, LOW); DigitalWrite (led10, LOW);

Verzögerung (del * 2);

// GRÜN 2

DigitalWrite (led2, HIGH); DigitalWrite (led3, LOW); DigitalWrite (led4, LOW); DigitalWrite (led5, LOW); DigitalWrite (led6, HIGH); DigitalWrite (led7, LOW); DigitalWrite (led8, HIGH); DigitalWrite (led9, LOW); DigitalWrite (led10, LOW); Verzögerung (del);

// GELB2

DigitalWrite (led2, HIGH); DigitalWrite (led3, LOW); DigitalWrite (led4, LOW); DigitalWrite (led5, HIGH); DigitalWrite (led6, LOW); DigitalWrite (led7, LOW); DigitalWrite (led8, HIGH); DigitalWrite (led9, LOW); DigitalWrite (led10, LOW);

Verzögerung (del / 2);

//ALLES ROT

DigitalWrite (led2, HIGH); DigitalWrite (led3, LOW); DigitalWrite (led4, LOW); DigitalWrite (led5, HIGH); DigitalWrite (led6, LOW); DigitalWrite (led7, LOW); DigitalWrite (led8, LOW); DigitalWrite (led9, LOW); DigitalWrite (led10, HIGH);

Verzögerung (2 * del);

// GREEEN2

DigitalWrite (led2, HIGH); DigitalWrite (led3, LOW); DigitalWrite (led4, LOW); DigitalWrite (led5, HIGH); DigitalWrite (led6, LOW); DigitalWrite (led7, LOW); DigitalWrite (led8, LOW); DigitalWrite (led9, HIGH); DigitalWrite (led10, LOW);

Verzögerung (del);

// GELB3

aufrechtzuerhalten.

Schritt 2: Weihnachtsbeleuchtung

Jetzt, da ich ein Lille mehr verstand, wollte ich spielen und einige Möglichkeiten erkunden.

Beachten Sie, dass die ersten beiden Spalten gleich sind. Aber ich fügte drei weitere Ausgänge und versuchte, damit es wie die Weihnachtsbeleuchtung funktioniert.

Kopieren Sie den folgenden Code und fügen Sie ihn ein.

Int led2 = 2;
Int led3 = 3; Int del = 1000; Int led4 = 4; Int led5 = 5; Int led6 = 6; Int led7 = 7; Int led8 = 8; Int led9 = 9; Int led10 = 10; Int led11 = 11; Int led12 = 12; Int led13 = 13;

// Die Setup-Routine läuft einmal, wenn Sie Reset:

Void setup () {// Initialisieren Sie den digitalen Pin als Oupput.

PinMode (led2, OUTPUT); PinMode (led3, AUSGANG); PinMode (led4, AUSGANG); PinMode (led5, AUSGANG); PinMode (led6, AUSGANG); PinMode (led7, AUSGANG); PinMode (led8, AUSGANG); PinMode (led9, AUSGANG); PinMode (led10, AUSGANG); PinMode (led11, AUSGANG); PinMode (led12, AUSGANG); PinMode (led13, AUSGANG); aufrechtzuerhalten.

// ALL EIN

Void loop () {digitalWrite (led2, HIGH); Verzögerung (del); DigitalWrite (led3, HIGH); Verzögerung (del / 2); DigitalWrite (led4, HIGH); Verzögerung (del / 3); DigitalWrite (led5, HIGH); Verzögerung (del / 4); DigitalWrite (led6, HIGH); Verzögerung (del / 5); DigitalWrite (led7, HIGH); Verzögerung (del / 6); DigitalWrite (led8, HIGH); Verzögerung (del / 7); DigitalWrite (led9, HIGH); Verzögerung (del / 8); DigitalWrite (led10, HIGH); Verzögerung (del / 9); DigitalWrite (led11, HIGH); Verzögerung (Del / 10); DigitalWrite (led12, HIGH); Verzögerung (del / 11); DigitalWrite (led13, HIGH); Verzögerung (del);

// ALL AUS

DigitalWrite (led2, LOW); DigitalWrite (led3, LOW); DigitalWrite (led4, LOW); DigitalWrite (led5, LOW); DigitalWrite (led6, LOW); DigitalWrite (led7, LOW); DigitalWrite (led8, LOW); DigitalWrite (led9, LOW); DigitalWrite (led10, LOW); DigitalWrite (led11, LOW); DigitalWrite (led12, LOW); DigitalWrite (led13, LOW); Verzögerung (del / 4);

DigitalWrite (led2, HIGH); Verzögerung (del / 3); DigitalWrite (led3, HIGH); Verzögerung (del / 3); DigitalWrite (led4, HIGH); Verzögerung (del / 3); DigitalWrite (led5, HIGH); Verzögerung (del / 3); DigitalWrite (led6, HIGH); Verzögerung (del / 3); DigitalWrite (led7, HIGH); Verzögerung (del / 3); DigitalWrite (led8, HIGH); Verzögerung (del / 3); DigitalWrite (led9, HIGH); Verzögerung (del / 3); DigitalWrite (led10, HIGH); Verzögerung (del / 3); DigitalWrite (led11, HIGH); Verzögerung (del / 3); DigitalWrite (led12, HIGH); Verzögerung (del / 3); DigitalWrite (led13, HIGH); Verzögerung (del);

// ALL AUS

DigitalWrite (led2, LOW); DigitalWrite (led3, LOW); DigitalWrite (led4, LOW); DigitalWrite (led5, LOW); DigitalWrite (led6, LOW); DigitalWrite (led7, LOW); DigitalWrite (led8, LOW); DigitalWrite (led9, LOW); DigitalWrite (led10, LOW); DigitalWrite (led11, LOW); DigitalWrite (led12, LOW); DigitalWrite (led13, LOW); Verzögerung (del / 4);

DigitalWrite (led2, HIGH); DigitalWrite (led3, HIGH); DigitalWrite (led4, HIGH); DigitalWrite (led5, HIGH); DigitalWrite (led6, HIGH); DigitalWrite (led7, HIGH); DigitalWrite (led8, HIGH); DigitalWrite (led9, HIGH); DigitalWrite (led10, HIGH); DigitalWrite (led11, HIGH); DigitalWrite (led12, HIGH); DigitalWrite (led13, HIGH);

Verzögerung (del / 4);

DigitalWrite (led2, LOW); DigitalWrite (led3, LOW); DigitalWrite (led4, LOW); DigitalWrite (led5, LOW); DigitalWrite (led6, LOW); DigitalWrite (led7, LOW); DigitalWrite (led8, LOW); DigitalWrite (led9, LOW); DigitalWrite (led10, LOW); DigitalWrite (led11, LOW); DigitalWrite (led12, LOW); DigitalWrite (led13, LOW); Verzögerung (del / 4);

DigitalWrite (led2, HIGH); DigitalWrite (led3, HIGH); DigitalWrite (led4, HIGH); DigitalWrite (led5, HIGH); DigitalWrite (led6, HIGH); DigitalWrite (led7, HIGH); DigitalWrite (led8, HIGH); DigitalWrite (led9, HIGH); DigitalWrite (led10, HIGH); DigitalWrite (led11, HIGH); DigitalWrite (led12, HIGH); DigitalWrite (led13, HIGH);

Verzögerung (del / 4); DigitalWrite (led2, LOW); DigitalWrite (led3, LOW); DigitalWrite (led4, LOW); DigitalWrite (led5, LOW); DigitalWrite (led6, LOW); DigitalWrite (led7, LOW); DigitalWrite (led8, LOW); DigitalWrite (led9, LOW); DigitalWrite (led10, LOW); DigitalWrite (led11, LOW); DigitalWrite (led12, LOW); DigitalWrite (led13, LOW); Verzögerung (del / 4);

DigitalWrite (led2, HIGH); Verzögerung (del / 5); DigitalWrite (led3, HIGH); Verzögerung (del / 5); DigitalWrite (led4, HIGH); Verzögerung (del / 5); DigitalWrite (led5, HIGH); Verzögerung (del / 5); DigitalWrite (led6, HIGH); Verzögerung (del / 5); DigitalWrite (led7, HIGH); Verzögerung (del / 5); DigitalWrite (led8, HIGH); Verzögerung (del / 5); DigitalWrite (led9, HIGH); Verzögerung (del / 5); DigitalWrite (led10, HIGH); Verzögerung (del / 5); DigitalWrite (led11, HIGH); Verzögerung (del / 5); DigitalWrite (led12, HIGH); Verzögerung (del / 5); DigitalWrite (led13, HIGH); Verzögerung (del);

DigitalWrite (led2, LOW); DigitalWrite (led3, LOW); DigitalWrite (led4, LOW); DigitalWrite (led5, LOW); DigitalWrite (led6, LOW); DigitalWrite (led7, LOW); DigitalWrite (led8, LOW); DigitalWrite (led9, LOW); DigitalWrite (led10, LOW); DigitalWrite (led11, LOW); DigitalWrite (led12, LOW); DigitalWrite (led13, LOW); Verzögerung (del / 4);

DigitalWrite (led2, HIGH); Verzögerung (del / 5); DigitalWrite (led3, HIGH); Verzögerung (del / 5); DigitalWrite (led4, HIGH); Verzögerung (del / 5); DigitalWrite (led5, HIGH); Verzögerung (del / 5); DigitalWrite (led6, HIGH); Verzögerung (del / 5); DigitalWrite (led7, HIGH); Verzögerung (del / 5); DigitalWrite (led8, HIGH); Verzögerung (del / 5); DigitalWrite (led9, HIGH); Verzögerung (del / 5); DigitalWrite (led10, HIGH); Verzögerung (del / 5); DigitalWrite (led11, HIGH); Verzögerung (del / 5); DigitalWrite (led12, HIGH); Verzögerung (del / 5); DigitalWrite (led13, HIGH); Verzögerung (del);

DigitalWrite (led2, LOW); DigitalWrite (led3, LOW); DigitalWrite (led4, LOW); DigitalWrite (led5, LOW); DigitalWrite (led6, LOW); DigitalWrite (led7, LOW); DigitalWrite (led8, LOW); DigitalWrite (led9, LOW); DigitalWrite (led10, LOW); DigitalWrite (led11, LOW); DigitalWrite (led12, LOW); DigitalWrite (led13, LOW); Verzögerung (del / 4); DigitalWrite (led2, HIGH); DigitalWrite (led3, HIGH); DigitalWrite (led4, HIGH); DigitalWrite (led5, HIGH); DigitalWrite (led6, HIGH); DigitalWrite (led7, HIGH); DigitalWrite (led8, HIGH); DigitalWrite (led9, HIGH); DigitalWrite (led10, HIGH); DigitalWrite (led11, HIGH); DigitalWrite (led12, HIGH); DigitalWrite (led13, HIGH);

Verzögerung (del / 4); DigitalWrite (led2, LOW); DigitalWrite (led3, LOW); DigitalWrite (led4, LOW); DigitalWrite (led5, LOW); DigitalWrite (led6, LOW); DigitalWrite (led7, LOW); DigitalWrite (led8, LOW); DigitalWrite (led9, LOW); DigitalWrite (led10, LOW); DigitalWrite (led11, LOW); DigitalWrite (led12, LOW); DigitalWrite (LED13, LOW); Verzögerung (del / 4); DigitalWrite (led2, HIGH); DigitalWrite (led3, HIGH); DigitalWrite (led4, HIGH); DigitalWrite (led5, HIGH); DigitalWrite (led6, HIGH); DigitalWrite (led7, HIGH); DigitalWrite (led8, HIGH); DigitalWrite (led9, HIGH); DigitalWrite (led10, HIGH); DigitalWrite (led11, HIGH); DigitalWrite (led12, HIGH); DigitalWrite (led13, HIGH);

Verzögerung (del / 4); DigitalWrite (led2, LOW); DigitalWrite (led3, LOW); DigitalWrite (led4, LOW); DigitalWrite (led5, LOW); DigitalWrite (led6, LOW); DigitalWrite (led7, LOW); DigitalWrite (led8, LOW); DigitalWrite (led9, LOW); DigitalWrite (led10, LOW); DigitalWrite (led11, LOW); DigitalWrite (led12, LOW); DigitalWrite (led13, LOW); Verzögerung (del / 4);

DigitalWrite (led2, HIGH); Verzögerung (del / 5); DigitalWrite (led3, HIGH); Verzögerung (del / 5); DigitalWrite (led4, HIGH); Verzögerung (del / 5); DigitalWrite (led5, HIGH); Verzögerung (del / 5); DigitalWrite (led6, HIGH); Verzögerung (del / 5); DigitalWrite (led7, HIGH); Verzögerung (del / 5); DigitalWrite (led8, HIGH); Verzögerung (del / 5); DigitalWrite (led9, HIGH); Verzögerung (del / 5); DigitalWrite (led10, HIGH); Verzögerung (del / 5); DigitalWrite (led11, HIGH); Verzögerung (del / 5); DigitalWrite (led12, HIGH); Verzögerung (del / 5); DigitalWrite (led13, HIGH); Verzögerung (del / 4);

DigitalWrite (led2, LOW); DigitalWrite (led3, LOW); DigitalWrite (led4, LOW); DigitalWrite (led5, LOW); DigitalWrite (led6, LOW); DigitalWrite (led7, LOW); DigitalWrite (led8, LOW); DigitalWrite (led9, LOW); DigitalWrite (led10, LOW); DigitalWrite (led11, LOW); DigitalWrite (led12, LOW); DigitalWrite (led13, LOW); Verzögerung (Del / 4); DigitalWrite (led13, HIGH); Verzögerung (del / 5); DigitalWrite (led12, HIGH); Verzögerung (del / 5); DigitalWrite (led11, HIGH); Verzögerung (del / 5); DigitalWrite (led10, HIGH); Verzögerung (del / 5); DigitalWrite (led9, HIGH); Verzögerung (del / 5); DigitalWrite (led8, HIGH); Verzögerung (del / 5); DigitalWrite (led7, HIGH); Verzögerung (del / 5); DigitalWrite (led6, HIGH); Verzögerung (del / 5); DigitalWrite (led5, HIGH); Verzögerung (del / 5); DigitalWrite (led4, HIGH); Verzögerung (del / 5); DigitalWrite (led3, HIGH); Verzögerung (del / 5); DigitalWrite (led2, HIGH); Verzögerung (del);

DigitalWrite (led2, LOW); DigitalWrite (led3, LOW); DigitalWrite (led4, LOW); DigitalWrite (led5, LOW); DigitalWrite (led6, LOW); DigitalWrite (led7, LOW); DigitalWrite (led8, LOW); DigitalWrite (led9, LOW); DigitalWrite (led10, LOW); DigitalWrite (led11, LOW); DigitalWrite (led12, LOW); DigitalWrite (led13, LOW); Verzögerung (del / 4);

DigitalWrite (led2, HIGH);

Verzögerung (del / 4);

DigitalWrite (led2, LOW); DigitalWrite (led3, HIGH);

Verzögerung (del / 4);

DigitalWrite (led3, LOW); DigitalWrite (led4, HIGH);

Verzögerung (del / 4);

DigitalWrite (led4, LOW); DigitalWrite (led5, HIGH);

Verzögerung (del / 4);

DigitalWrite (led5, LOW); DigitalWrite (led6, HIGH);

Verzögerung (del / 4);

DigitalWrite (led6, LOW); DigitalWrite (led7, HIGH);

Verzögerung (del / 4);

DigitalWrite (led7, LOW); DigitalWrite (led8, HIGH);

Verzögerung (del / 4);

DigitalWrite (led8, LOW); DigitalWrite (led9, HIGH);

Verzögerung (del / 4);

DigitalWrite (led9, LOW); DigitalWrite (led10, HIGH);

Verzögerung (del / 4);

DigitalWrite (led10, LOW); DigitalWrite (led11, HIGH);

Verzögerung (Del / 4);

DigitalWrite (led11, LOW); DigitalWrite (led12, HIGH);

Verzögerung (del / 4);

DigitalWrite (led12, LOW); DigitalWrite (led13, HIGH); Verzögerung (del / 4);

DigitalWrite (led3, LOW); DigitalWrite (led4, LOW); DigitalWrite (led5, LOW); DigitalWrite (led6, LOW); DigitalWrite (led7, LOW); DigitalWrite (led8, LOW); DigitalWrite (led9, LOW); DigitalWrite (led10, LOW); DigitalWrite (led11, LOW); DigitalWrite (led12, LOW); DigitalWrite (led13, LOW); Verzögerung (del / 4);

DigitalWrite (led2, HIGH); Verzögerung (del / 5); DigitalWrite (led3, HIGH); Verzögerung (del / 5); DigitalWrite (led4, HIGH); Verzögerung (del / 5); DigitalWrite (led5, HIGH); Verzögerung (del / 5); DigitalWrite (led6, HIGH); Verzögerung (del / 5); DigitalWrite (led7, HIGH); Verzögerung (del / 5); DigitalWrite (led8, HIGH); Verzögerung (del / 5); DigitalWrite (led9, HIGH); Verzögerung (del / 5); DigitalWrite (led10, HIGH); Verzögerung (del / 5); DigitalWrite (led11, HIGH); Verzögerung (del / 5); DigitalWrite (led12, HIGH); Verzögerung (del / 5); DigitalWrite (led13, HIGH); Verzögerung (del / 4);

DigitalWrite (led2, LOW); DigitalWrite (led3, LOW); DigitalWrite (led4, LOW); DigitalWrite (led5, LOW); DigitalWrite (led6, LOW); DigitalWrite (led7, LOW); DigitalWrite (led8, LOW); DigitalWrite (led9, LOW); DigitalWrite (led10, LOW); DigitalWrite (led11, LOW); DigitalWrite (led12, LOW); DigitalWrite (led13, LOW); Verzögerung (del / 4);

DigitalWrite (led13, HIGH); Verzögerung (del / 5); DigitalWrite (led12, HIGH); Verzögerung (del / 5); DigitalWrite (led11, HIGH); Verzögerung (del / 5); DigitalWrite (led10, HIGH); Verzögerung (del / 5); DigitalWrite (led9, HIGH); Verzögerung (del / 5); DigitalWrite (led8, HIGH); Verzögerung (del / 5); DigitalWrite (led7, HIGH); Verzögerung (del / 5); DigitalWrite (led6, HIGH); Verzögerung (del / 5); DigitalWrite (led5, HIGH); Verzögerung (Del / 5); DigitalWrite (led4, HIGH); Verzögerung (del / 5); DigitalWrite (led3, HIGH); Verzögerung (del / 5); DigitalWrite (led2, HIGH); Verzögerung (del);

DigitalWrite (led2, LOW); DigitalWrite (led3, LOW); DigitalWrite (led4, LOW); DigitalWrite (led5, LOW); DigitalWrite (led6, LOW); DigitalWrite (led7, LOW); DigitalWrite (led8, LOW); DigitalWrite (led9, LOW); DigitalWrite (led10, LOW); DigitalWrite (led11, LOW); DigitalWrite (led12, LOW); DigitalWrite (led13, LOW); Verzögerung (del / 4);

DigitalWrite (led2, HIGH); DigitalWrite (led3, HIGH); DigitalWrite (led4, HIGH); DigitalWrite (led5, HIGH); DigitalWrite (led6, HIGH); DigitalWrite (led7, HIGH); DigitalWrite (led8, HIGH); DigitalWrite (led9, HIGH); DigitalWrite (led10, HIGH); DigitalWrite (led11, HIGH); DigitalWrite (led12, HIGH); DigitalWrite (led13, HIGH);

Verzögerung (del / 4); DigitalWrite (led2, LOW); DigitalWrite (led3, LOW); DigitalWrite (led4, LOW); DigitalWrite (led5, LOW); DigitalWrite (led6, LOW); DigitalWrite (led7, LOW); DigitalWrite (led8, LOW); DigitalWrite (led9, LOW); DigitalWrite (led10, LOW); DigitalWrite (led11, LOW); DigitalWrite (led12, LOW); DigitalWrite (led13, LOW); Verzögerung (del / 4);

DigitalWrite (led2, HIGH); DigitalWrite (led3, HIGH); DigitalWrite (led4, HIGH); DigitalWrite (led5, HIGH); DigitalWrite (led6, HIGH); DigitalWrite (led7, HIGH); DigitalWrite (led8, HIGH); DigitalWrite (led9, HIGH); DigitalWrite (led10, HIGH); DigitalWrite (led11, HIGH); DigitalWrite (led12, HIGH); DigitalWrite (led13, HIGH);

Verzögerung (del / 4); DigitalWrite (led2, LOW); DigitalWrite (led3, LOW); DigitalWrite (led4, LOW); DigitalWrite (led5, LOW); DigitalWrite (led6, LOW); DigitalWrite (led7, LOW); DigitalWrite (led8, LOW); DigitalWrite (led9, LOW); DigitalWrite (led10, LOW); DigitalWrite (led11, LOW); DigitalWrite (led12, LOW); DigitalWrite (led13, LOW); Verzögerung (del / 4);

DigitalWrite (led2, HIGH);

Verzögerung (del / 4);

DigitalWrite (led2, LOW); DigitalWrite (led3, HIGH);

Verzögerung (del / 4);

DigitalWrite (led3, LOW); DigitalWrite (led4, HIGH);

Verzögerung (del / 4);

DigitalWrite (led4, LOW); DigitalWrite (led5, HIGH);

Verzögerung (del / 4);

DigitalWrite (led5, LOW); DigitalWrite (led6, HIGH);

Verzögerung (del / 4);

DigitalWrite (led6, LOW); DigitalWrite (led7, HIGH);

Verzögerung (del / 4);

DigitalWrite (led7, LOW); DigitalWrite (led8, HIGH);

Verzögerung (del / 4);

DigitalWrite (led8, LOW); DigitalWrite (led9, HIGH);

Verzögerung (del / 4);

DigitalWrite (led9, LOW); DigitalWrite (led10, HIGH);

Verzögerung (del / 4);

DigitalWrite (led10, LOW); DigitalWrite (led11, HIGH);

Verzögerung (del / 4);

DigitalWrite (led11, LOW); DigitalWrite (led12, HIGH);

Verzögerung (del / 4);

DigitalWrite (led2, LOW); DigitalWrite (led3, LOW); DigitalWrite (led4, LOW); DigitalWrite (led5, LOW); DigitalWrite (led6, LOW); DigitalWrite (led7, LOW); DigitalWrite (led8, LOW); DigitalWrite (led9, LOW); DigitalWrite (led10, LOW); DigitalWrite (led11, LOW); DigitalWrite (led12, LOW); DigitalWrite (led13, HIGH); Verzögerung (del / 4);

DigitalWrite (led2, LOW); DigitalWrite (led3, LOW); DigitalWrite (led4, LOW); DigitalWrite (led5, LOW); DigitalWrite (led6, LOW); DigitalWrite (led7, LOW); DigitalWrite (led8, LOW); DigitalWrite (led9, LOW); DigitalWrite (led10, LOW); DigitalWrite (led11, LOW); DigitalWrite (led12, LOW); DigitalWrite (led13, LOW); Verzögerung (del / 4);

DigitalWrite (led2, HIGH); DigitalWrite (led3, HIGH); Verzögerung (del / 4); DigitalWrite (led2, LOW); DigitalWrite (led3, LOW); DigitalWrite (led4, HIGH); DigitalWrite (led5, HIGH); Verzögerung (del / 4); DigitalWrite (led2, HIGH); DigitalWrite (led3, HIGH); DigitalWrite (led4, LOW); DigitalWrite (led5, LOW); DigitalWrite (led6, HIGH); DigitalWrite (led7, HIGH); Verzögerung (del / 4); DigitalWrite (led2, LOW); DigitalWrite (led3, LOW); DigitalWrite (led4, HIGH); DigitalWrite (led5, HIGH); DigitalWrite (led6, LOW); DigitalWrite (led7, LOW); DigitalWrite (led8, HIGH); DigitalWrite (led9, HIGH); Verzögerung (del / 4);

DigitalWrite (led2, HIGH); DigitalWrite (led3, HIGH); DigitalWrite (led4, LOW); DigitalWrite (led5, LOW); DigitalWrite (led6, HIGH); DigitalWrite (led7, HIGH); DigitalWrite (led8, LOW); DigitalWrite (led9, LOW); DigitalWrite (led10, HIGH); DigitalWrite (led11, HIGH); Verzögerung (del / 4);

DigitalWrite (led2, LOW); DigitalWrite (led3, LOW); DigitalWrite (led4, HIGH); DigitalWrite (led5, HIGH); DigitalWrite (led6, LOW); DigitalWrite (led7, LOW); DigitalWrite (led8, HIGH); DigitalWrite (led9, HIGH); DigitalWrite (led10, LOW); DigitalWrite (led11, LOW); DigitalWrite (led12, HIGH); DigitalWrite (led13, HIGH); Verzögerung (Del / 4);

DigitalWrite (led2, LOW); DigitalWrite (led3, LOW); DigitalWrite (led4, LOW); DigitalWrite (led5, LOW); DigitalWrite (led6, LOW); DigitalWrite (led7, LOW); DigitalWrite (led8, LOW); DigitalWrite (led9, LOW); DigitalWrite (led10, LOW); DigitalWrite (led11, LOW); DigitalWrite (led12, LOW); DigitalWrite (led13, LOW); Verzögerung (del / 4); aufrechtzuerhalten.

Schritt 3: Vorwärtsbewegung

Ich dachte in einem Wurm, als ich das schrieb.

Int led2 = 2;

Int led3 = 3; Int del = 1000; Int led4 = 4; Int led5 = 5; Int led6 = 6; Int led7 = 7; Int led8 = 8; Int led9 = 9; Int led10 = 10; Int led11 = 11; Int led12 = 12; Int led13 = 13;

// Die Setup-Routine läuft einmal, wenn Sie Reset:

Void setup () {// Initialisieren Sie den digitalen Pin als Oupput.

PinMode (led2, OUTPUT); PinMode (led3, AUSGANG); PinMode (led4, AUSGANG); PinMode (led5, AUSGANG); PinMode (led6, AUSGANG); PinMode (led7, AUSGANG); PinMode (led8, AUSGANG); PinMode (led9, AUSGANG); PinMode (led10, AUSGANG); PinMode (led11, AUSGANG); PinMode (led12, AUSGANG); PinMode (led13, AUSGANG); aufrechtzuerhalten.

Void loop () {digitalWrite (led2, HIGH); DigitalWrite (led3, HIGH); Verzögerung (del / 4); DigitalWrite (led2, LOW); DigitalWrite (led3, LOW); DigitalWrite (led4, HIGH); DigitalWrite (led5, HIGH); Verzögerung (del / 4); DigitalWrite (led2, HIGH); DigitalWrite (led3, HIGH); DigitalWrite (led4, LOW); DigitalWrite (led5, LOW); DigitalWrite (led6, HIGH); DigitalWrite (led7, HIGH); Verzögerung (del / 4); DigitalWrite (led2, LOW); DigitalWrite (led3, LOW); DigitalWrite (led4, HIGH); DigitalWrite (led5, HIGH); DigitalWrite (led6, LOW); DigitalWrite (led7, LOW); DigitalWrite (led8, HIGH); DigitalWrite (led9, HIGH); Verzögerung (del / 4);

DigitalWrite (led2, HIGH); DigitalWrite (led3, HIGH); DigitalWrite (led4, LOW); DigitalWrite (led5, LOW); DigitalWrite (led6, HIGH); DigitalWrite (led7, HIGH); DigitalWrite (led8, LOW); DigitalWrite (led9, LOW); DigitalWrite (led10, HIGH); DigitalWrite (led11, HIGH); Verzögerung (del / 4);

DigitalWrite (led2, LOW); DigitalWrite (led3, LOW); DigitalWrite (led4, HIGH); DigitalWrite (led5, HIGH); DigitalWrite (led6, LOW); DigitalWrite (led7, LOW); DigitalWrite (led8, HIGH); DigitalWrite (led9, HIGH); DigitalWrite (led10, LOW); DigitalWrite (led11, LOW); DigitalWrite (led12, HIGH); DigitalWrite (led13, HIGH); Verzögerung (del / 4); DigitalWrite (led2, LOW); DigitalWrite (led3, LOW); DigitalWrite (led4, LOW); DigitalWrite (led5, LOW); DigitalWrite (led6, LOW); DigitalWrite (led7, LOW); DigitalWrite (led8, LOW); DigitalWrite (led9, LOW); DigitalWrite (led10, LOW); DigitalWrite (led11, LOW); DigitalWrite (led12, LOW); DigitalWrite (led13, LOW);

aufrechtzuerhalten.

Related Reading