Programmierung von 3D LED Cube

Themabewertung:
  • 0 Bewertung(en) - 0 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5
tesacrep
Administrator
*******

Beiträge: 504
Registriert seit: Dec 2013
Bewertung: 2
#1
27.12.2013, 19:58

Programmierung von 3D LED Cube:
Die Programmierung des LED Cubes findet mit digitalWrite() statt.

 
// Led Cube 3x3 3D
 
 
// Ausgänge
int eins = 10;
int zwei = 9;
int drei = 8;
int vier = 7;
int funf = 6;
int sechs = 5;
int sieben = 4;
int acht = 3;
int neun = 2;
 
// Eingänge
 
int eeins = 11;
int ezwei = 12;
int edrei = 13;
 
 
void setup () {

pinMode(eins, OUTPUT);
pinMode(zwei, OUTPUT);
pinMode(drei, OUTPUT);
pinMode(vier, OUTPUT);
pinMode(funf, OUTPUT);
pinMode(sechs, OUTPUT);
pinMode(sieben, OUTPUT);
pinMode(acht, OUTPUT);
pinMode(neun, OUTPUT);

pinMode(eeins, OUTPUT);
pinMode(ezwei, OUTPUT);
pinMode(edrei, OUTPUT);

}
 
 
void loop () {
digitalWrite(ezwei, LOW);
digitalWrite(eeins, LOW);
digitalWrite(edrei, LOW);
 
digitalWrite(eins, HIGH);
digitalWrite(zwei, HIGH);
digitalWrite(drei, HIGH);
 
delay (500);
 
digitalWrite(eins, LOW);
digitalWrite(zwei, LOW);
digitalWrite(drei, LOW);
 
digitalWrite(vier, HIGH);
digitalWrite(funf, HIGH);
digitalWrite(sechs, HIGH);
 
delay (500);
 
digitalWrite(vier, LOW);
digitalWrite(funf, LOW);
digitalWrite(sechs, LOW);
 
digitalWrite(sieben, HIGH);
digitalWrite(acht, HIGH);
digitalWrite(neun, HIGH);
 
delay (500);
 
digitalWrite(sieben, LOW);
digitalWrite(acht, LOW);
digitalWrite(neun, LOW);
 
 
digitalWrite(sechs, HIGH);
digitalWrite(funf, HIGH);
digitalWrite(vier, HIGH);
 
delay (500);
 
digitalWrite(vier, LOW);
digitalWrite(funf, LOW);
digitalWrite(sechs, LOW);
 
digitalWrite(eins, HIGH);
digitalWrite(zwei, HIGH);
digitalWrite(drei, HIGH);
 
delay (500);
 
digitalWrite(eins, LOW);
digitalWrite(zwei, LOW);
digitalWrite(drei, LOW);
 
delay (500);

digitalWrite(eeins, LOW);
digitalWrite(ezwei, HIGH);
digitalWrite(edrei, HIGH);
 
digitalWrite(eins, HIGH);
digitalWrite(zwei, HIGH);
digitalWrite(drei, HIGH);
digitalWrite(vier, HIGH);
digitalWrite(sechs, HIGH);
digitalWrite(sieben, HIGH);
digitalWrite(acht, HIGH);
digitalWrite(neun, HIGH);
digitalWrite(funf, HIGH);
 
delay (500);
 
digitalWrite(eeins, HIGH);
digitalWrite(ezwei, LOW);
digitalWrite(edrei, HIGH);
 
delay (500);
 
 
digitalWrite(eeins, HIGH);
digitalWrite(ezwei, HIGH);
digitalWrite(edrei, LOW);
 
delay (500);
 
digitalWrite(eeins, HIGH);
digitalWrite(ezwei, LOW);
digitalWrite(edrei, HIGH);
 
delay (500);
 
digitalWrite(eeins, LOW);
digitalWrite(ezwei, HIGH);
digitalWrite(edrei, HIGH);
 
delay (500);

digitalWrite(eeins, HIGH);
digitalWrite(ezwei, HIGH);
digitalWrite(edrei, HIGH);
 
delay (500);
 
digitalWrite(eeins, LOW);
digitalWrite(ezwei, LOW);
digitalWrite(edrei, LOW);
delay(250);
 
digitalWrite(eeins, HIGH);
digitalWrite(ezwei, HIGH);
digitalWrite(edrei, HIGH);
delay(250);
 
digitalWrite(eeins, LOW);
digitalWrite(ezwei, LOW);
digitalWrite(edrei, LOW);
delay(250);
 
digitalWrite(eeins, HIGH);
digitalWrite(ezwei, HIGH);
digitalWrite(edrei, HIGH);
delay(250);
 
digitalWrite(eeins, LOW);
digitalWrite(ezwei, LOW);
digitalWrite(edrei, LOW);
delay(250);
 
digitalWrite(eeins, HIGH);
digitalWrite(ezwei, HIGH);
digitalWrite(edrei, HIGH);
delay(250);
 
digitalWrite(eeins, LOW);
digitalWrite(ezwei, LOW);
digitalWrite(edrei, LOW);
delay(250);
 
digitalWrite(eeins, HIGH);
digitalWrite(ezwei, HIGH);
digitalWrite(edrei, HIGH);
delay(250);
 
digitalWrite(eeins, LOW);
digitalWrite(ezwei, LOW);
digitalWrite(edrei, LOW);
delay(250);
 
digitalWrite(eeins, HIGH);
digitalWrite(ezwei, HIGH);
digitalWrite(edrei, HIGH);
delay(250);
 
digitalWrite(eins, LOW);
digitalWrite(zwei, LOW);
digitalWrite(drei, LOW);
digitalWrite(vier, LOW);
digitalWrite(sechs, LOW);
digitalWrite(sieben, LOW);
digitalWrite(acht, LOW);
digitalWrite(neun, LOW);
digitalWrite(funf, HIGH);
 
digitalWrite(eeins, LOW);
digitalWrite(ezwei, HIGH);
digitalWrite(edrei, HIGH);
 
delay (200);
 
digitalWrite(eeins, HIGH);
digitalWrite(ezwei, LOW);
digitalWrite(edrei, HIGH);
 
delay (200);
 
digitalWrite(eeins, HIGH);
digitalWrite(ezwei, HIGH);
digitalWrite(edrei, LOW);
 
delay (200);
 
digitalWrite(eins, HIGH);
digitalWrite(zwei, HIGH);
digitalWrite(drei, HIGH);
digitalWrite(vier, HIGH);
digitalWrite(sechs, HIGH);
digitalWrite(sieben, HIGH);
digitalWrite(acht, HIGH);
digitalWrite(neun, HIGH);
digitalWrite(funf, HIGH);
 
delay (300);
 
digitalWrite(eeins, HIGH);
digitalWrite(ezwei, LOW);
digitalWrite(edrei, LOW);
 
delay (300);
 
digitalWrite(eeins, LOW);
digitalWrite(ezwei, LOW);
digitalWrite(edrei, LOW);
delay (1000);
 
digitalWrite(eins, LOW);
digitalWrite(zwei, LOW);
digitalWrite(drei, LOW);
digitalWrite(vier, LOW);
digitalWrite(sechs, LOW);
digitalWrite(sieben, LOW);
digitalWrite(acht, LOW);
digitalWrite(neun, LOW);
digitalWrite(funf, HIGH);
 
delay (700);
 
digitalWrite(eeins, HIGH);
digitalWrite(ezwei, HIGH);
digitalWrite(edrei, LOW);
 
digitalWrite(eins, LOW);
digitalWrite(zwei, LOW);
digitalWrite(drei, LOW);
digitalWrite(vier, LOW);
digitalWrite(sechs, LOW);
digitalWrite(sieben, LOW);
digitalWrite(acht, LOW);
digitalWrite(neun, LOW);
digitalWrite(funf, HIGH);
 
delay (250);

digitalWrite(eins, LOW);
digitalWrite(zwei, LOW);
digitalWrite(drei, LOW);
digitalWrite(vier, LOW);
digitalWrite(sechs, HIGH);
digitalWrite(sieben, LOW);
digitalWrite(acht, LOW);
digitalWrite(neun, LOW);
digitalWrite(funf, HIGH);
 
delay (250);
 
digitalWrite(eins, LOW);
digitalWrite(zwei, LOW);
digitalWrite(drei, LOW);
digitalWrite(vier, LOW);
digitalWrite(sechs, HIGH);
digitalWrite(sieben, HIGH);
digitalWrite(acht, LOW);
digitalWrite(neun, LOW);
digitalWrite(funf, HIGH);
 
delay (250);
 
digitalWrite(eins, LOW);
digitalWrite(zwei, LOW);
digitalWrite(drei, LOW);
digitalWrite(vier, LOW);
digitalWrite(sechs, HIGH);
digitalWrite(sieben, HIGH);
digitalWrite(acht, HIGH);
digitalWrite(neun, LOW);
digitalWrite(funf, HIGH);
 
delay (250);
 
digitalWrite(eins, LOW);
digitalWrite(zwei, LOW);
digitalWrite(drei, LOW);
digitalWrite(vier, LOW);
digitalWrite(sechs, HIGH);
digitalWrite(sieben, HIGH);
digitalWrite(acht, HIGH);
digitalWrite(neun, HIGH);
digitalWrite(funf, HIGH);
 
delay (250);
 
digitalWrite(eins, HIGH);
digitalWrite(zwei, LOW);
digitalWrite(drei, LOW);
digitalWrite(vier, LOW);
digitalWrite(sechs, HIGH);
digitalWrite(sieben, HIGH);
digitalWrite(acht, HIGH);
digitalWrite(neun, HIGH);
digitalWrite(funf, HIGH);
 
delay (250);
 
digitalWrite(eins, HIGH);
digitalWrite(zwei, HIGH);
digitalWrite(drei, LOW);
digitalWrite(vier, LOW);
digitalWrite(sechs, HIGH);
digitalWrite(sieben, HIGH);
digitalWrite(acht, HIGH);
digitalWrite(neun, HIGH);
digitalWrite(funf, HIGH);
 
delay (250);
 
 
digitalWrite(eins, HIGH);
digitalWrite(zwei, HIGH);
digitalWrite(drei, HIGH);
digitalWrite(vier, LOW);
digitalWrite(sechs, HIGH);
digitalWrite(sieben, HIGH);
digitalWrite(acht, HIGH);
digitalWrite(neun, HIGH);
digitalWrite(funf, HIGH);
 
delay (250);
 
digitalWrite(eins, HIGH);
digitalWrite(zwei, HIGH);
digitalWrite(drei, HIGH);
digitalWrite(vier, HIGH);
digitalWrite(sechs, HIGH);
digitalWrite(sieben, HIGH);
digitalWrite(acht, HIGH);
digitalWrite(neun, HIGH);
digitalWrite(funf, HIGH);
 
delay (500);
 
digitalWrite(eeins, HIGH);
digitalWrite(ezwei, HIGH);
digitalWrite(edrei, HIGH);
delay(250);
 
digitalWrite(eeins, HIGH);
digitalWrite(ezwei, HIGH);
digitalWrite(edrei, LOW);
delay(250);
 
digitalWrite(eeins, HIGH);
digitalWrite(ezwei, HIGH);
digitalWrite(edrei, HIGH);
delay(250);
 
 
digitalWrite(eeins, HIGH);
digitalWrite(ezwei, LOW);
digitalWrite(edrei, LOW);
delay(250);
 
digitalWrite(eeins, HIGH);
digitalWrite(ezwei, HIGH);
digitalWrite(edrei, HIGH);
delay(250);
 
digitalWrite(eeins, LOW);
digitalWrite(ezwei, LOW);
digitalWrite(edrei, LOW);
delay(2000);
//Eins
digitalWrite(eins, LOW);
digitalWrite(zwei, LOW);
digitalWrite(drei, LOW);
digitalWrite(vier, LOW);
digitalWrite(sechs, LOW);
digitalWrite(sieben, LOW);
digitalWrite(acht, LOW);
digitalWrite(neun, LOW);
digitalWrite(funf, HIGH);
 
delay (750);
// Zwei
digitalWrite(eins, HIGH);
digitalWrite(zwei, LOW);
digitalWrite(drei, LOW);
digitalWrite(vier, LOW);
digitalWrite(sechs, LOW);
digitalWrite(sieben, LOW);
digitalWrite(acht, LOW);
digitalWrite(neun, HIGH);
digitalWrite(funf, LOW);
 
delay (750);
//Drei
digitalWrite(eins, HIGH);
digitalWrite(zwei, LOW);
digitalWrite(drei, LOW);
digitalWrite(vier, LOW);
digitalWrite(sechs, LOW);
digitalWrite(sieben, LOW);
digitalWrite(acht, LOW);
digitalWrite(neun, HIGH);
digitalWrite(funf, HIGH);
 
delay (750);
// Vier
digitalWrite(eins, HIGH);
digitalWrite(zwei, LOW);
digitalWrite(drei, HIGH);
digitalWrite(vier, LOW);
digitalWrite(sechs, LOW);
digitalWrite(sieben, HIGH);
digitalWrite(acht, LOW);
digitalWrite(neun, HIGH);
digitalWrite(funf, LOW);
 
delay (750);
// Fünf
digitalWrite(eins, HIGH);
digitalWrite(zwei, LOW);
digitalWrite(drei, HIGH);
digitalWrite(vier, LOW);
digitalWrite(sechs, LOW);
digitalWrite(sieben, HIGH);
digitalWrite(acht, LOW);
digitalWrite(neun, HIGH);
digitalWrite(funf, HIGH);
 
delay (750);
 
// sechs
digitalWrite(eins, HIGH);
digitalWrite(zwei, LOW);
digitalWrite(drei, HIGH);
digitalWrite(vier, HIGH);
digitalWrite(sechs, HIGH);
digitalWrite(sieben, HIGH);
digitalWrite(acht, LOW);
digitalWrite(neun, HIGH);
digitalWrite(funf, LOW);
 
delay (2000);
 
digitalWrite(eins, HIGH);
digitalWrite(zwei, HIGH);
digitalWrite(drei, HIGH);
digitalWrite(vier, HIGH);
digitalWrite(sechs, HIGH);
digitalWrite(sieben, HIGH);
digitalWrite(acht, HIGH);
digitalWrite(neun, HIGH);
digitalWrite(funf, HIGH);
 
digitalWrite(eeins, HIGH);
digitalWrite(ezwei, HIGH);
digitalWrite(edrei, HIGH);
delay(250);
 
digitalWrite(eeins, LOW);
digitalWrite(ezwei, LOW);
digitalWrite(edrei, LOW);
delay(250);
 
digitalWrite(eeins, HIGH);
digitalWrite(ezwei, HIGH);
digitalWrite(edrei, HIGH);
delay(250);
 
digitalWrite(eeins, LOW);
digitalWrite(ezwei, LOW);
digitalWrite(edrei, LOW);
delay(250);
 
digitalWrite(eeins, HIGH);
digitalWrite(ezwei, HIGH);
digitalWrite(edrei, HIGH);
delay(250);
 
digitalWrite(eeins, LOW);
digitalWrite(ezwei, LOW);
digitalWrite(edrei, LOW);
delay(3000);
 
//Zurücksetzen auf Anfang
digitalWrite(eins, LOW);
digitalWrite(zwei, LOW);
digitalWrite(drei, LOW);
digitalWrite(vier, LOW);
digitalWrite(sechs, LOW);
digitalWrite(sieben, LOW);
digitalWrite(acht, LOW);
digitalWrite(neun, LOW);
digitalWrite(funf, LOW);
 
digitalWrite(eeins, HIGH);
digitalWrite(ezwei, HIGH);
digitalWrite(edrei, HIGH);
// Ende
 
}
 

Hier ein Video das das Programm zeigt:




Hier kann man den Code Heruterladen.

.ino   sketch_dec08a.ino (Größe: 9,84 KB / Downloads: 766)
(Dieser Beitrag wurde zuletzt bearbeitet: 12.09.2014, 22:44 von tesacrep.)
Zitieren


Gehe zu:


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste