Sonnenschutz_002.ino
1 |
| 2 | int a = 2;
| 3 | int b;
| 4 | int c;
| 5 | // int x;
| 6 | // int y;
| 7 | // int z;
| 8 | int W = 10;
| 9 | int X = 11;
| 10 | int Y = 12;
| 11 | int Z = 13;
| 12 | int h = 4;
| 13 | int i = 5;
| 14 | int j = 6;
| 15 | int k = 7;
| 16 |
| 17 |
| 18 | void setup() {
| 19 |
| 20 | pinMode(a,INPUT_PULLUP); // HIGH bei Sonne
| 21 | pinMode(h,INPUT_PULLUP); // Unterbrecher unten rechts
| 22 | pinMode(i,INPUT_PULLUP); // Unterbrecher oben rechts
| 23 | pinMode(j,INPUT_PULLUP); // Unterbrecher unten links
| 24 | pinMode(k,INPUT_PULLUP); // Unterbrecher oben links
| 25 | pinMode(W,OUTPUT);
| 26 | pinMode(X,OUTPUT); // wx Motor rechts
| 27 | pinMode(Y,OUTPUT);
| 28 | pinMode(Z,OUTPUT); // yz Motor links
| 29 |
| 30 | }
| 31 |
| 32 | void loop() {
| 33 | b = ! digitalRead(a) ;
| 34 | c = b && digitalRead(h);
| 35 | if (c == HIGH) // W an Pin 10
| 36 | {
| 37 | digitalWrite(W,HIGH);
| 38 | }
| 39 | else
| 40 | {
| 41 | digitalWrite(W,LOW);
| 42 | }
| 43 | }
|
|