Compare commits

...

2 Commits

Author SHA1 Message Date
2c4f2301ce Schalter fertig 2024-12-31 16:34:56 +01:00
21fa69a32d Lösungsvorschläge für Fragen 2024-12-30 21:47:58 +01:00
7 changed files with 143 additions and 440 deletions

View File

@ -60,7 +60,6 @@ Jetzt nehmen wir den Wert, den uns der Lichtsensor gegeben hat und sagen der del
## Und wie könnte es weiter gehen?
* hast du noch den Piepser zur Hand? Könntest du den Piepser heller oder dunkler piepsen lassen, je nachdem, wie hell oder dunkel es ist?
<details>
<summary>Hier klicken für Lösungsvorschläge - aber bitte erst selbst probieren! </summary>
@ -68,19 +67,46 @@ Jetzt nehmen wir den Wert, den uns der Lichtsensor gegeben hat und sagen der del
//TODO: Lösungsvorschlag anpassen
#define PIEPSER 12
int ledPin = LED_BUILTIN;
int sensorPin = A0;
int sensorWert = 0;
void setup() {
pinMode(PIEPSER, OUTPUT);
pinMode(ledPin, OUTPUT);
}
void loop() {
tone(PIEPSER, 1000);
delay(1000);
tone(PIEPSER, 500);
delay(1000);
tone(PIEPSER, 1000);
delay(1000);
tone(PIEPSER, 500);
delay(1000);
sensorWert = analogRead(sensorPin);
tone(PIEPSER, sensorWert);
}
```
</details>
* Und wie müsste das Programm aussehen, wenn wir ohne die Variable "sensorWert" auskommen wollten?
<details>
<summary>Hier klicken für Lösungsvorschläge - aber bitte erst selbst probieren! </summary>
```c
//TODO: Lösungsvorschlag anpassen
int sensorPin = A0;
int ledPin = LED_BUILTIN;
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop() {
digitalWrite(ledPin, HIGH);
// Hier wir dei Ausgabe von analogRead() direkt an die Funktion delay() übergeben, ohne diese zuerst abzuspeichern. Das geht auch, ist aber unübersichtlicher
delay(analogRead(sensorPin));
digitalWrite(ledPin, LOW);
// hier noch mal
delay(analogRead(sensorPin));
}
```
</details>

View File

@ -1,431 +0,0 @@
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<!-- Created with Fritzing (https://fritzing.org/) -->
<svg xmlns="http://www.w3.org/2000/svg" baseProfile="tiny" height="2.92502in" version="1.2" viewBox="0 0 174.179 210.601" width="2.41915in" x="0in" xmlns:svg="http://www.w3.org/2000/svg" y="0in">
<g id="watermark" >
<g >
<g >
<path d="M149.447,204.401c-0.604,0,-1.131,0.325,-1.422,0.809l-2.796,0l3.96,-4.071c0.146,-0.146,0.289,-0.322,0.428,-0.521c0.149,-0.222,0.228,-0.479,0.228,-0.768c0,-0.279,-0.097,-0.518,-0.287,-0.71c-0.19,-0.188,-0.444,-0.287,-0.754,-0.287l-4.636,0c-0.305,0,-0.555,0.06,-0.742,0.17c-0.219,0.13,-0.33,0.368,-0.33,0.707c0,0.329,0.111,0.562,0.33,0.692c0.188,0.111,0.438,0.168,0.742,0.168l3.148,0l-3.974,4.086c-0.146,0.147,-0.289,0.315,-0.425,0.504c-0.153,0.212,-0.23,0.472,-0.23,0.771c0,0.28,0.096,0.521,0.288,0.711c0.188,0.188,0.442,0.285,0.754,0.285l4.315,0c0.293,0.467,0.812,0.776,1.4,0.776c0.916,0,1.66,-0.744,1.66,-1.661C151.106,205.146,150.361,204.401,149.447,204.401zM149.447,206.664c-0.334,0,-0.604,-0.271,-0.604,-0.604c0,-0.333,0.27,-0.604,0.604,-0.604c0.332,0,0.604,0.271,0.604,0.604C150.05,206.395,149.779,206.664,149.447,206.664z" fill="#8C8C8C" />
<path d="M132.504,194.359c-0.914,0,-1.659,0.745,-1.659,1.66c0,0.916,0.745,1.66,1.659,1.66s1.658,-0.744,1.658,-1.66C134.164,195.104,133.42,194.359,132.504,194.359zM132.505,196.622c-0.333,0,-0.604,-0.27,-0.604,-0.603s0.271,-0.603,0.604,-0.603c0.331,0,0.604,0.27,0.604,0.603S132.836,196.622,132.505,196.622z" fill="#8C8C8C" />
<path d="M141.025,199.021c-0.193,-0.111,-0.439,-0.169,-0.732,-0.169l-1.465,0L138.828,196.33c0,-0.292,-0.057,-0.538,-0.166,-0.729C138.572,195.444,138.379,195.259,137.969,195.259c-0.34,0,-0.578,0.116,-0.709,0.342c-0.109,0.193,-0.167,0.438,-0.167,0.729l0,2.521l-0.481,0c-0.295,0,-0.539,0.06,-0.731,0.169c-0.228,0.129,-0.341,0.368,-0.341,0.708c0,0.412,0.185,0.603,0.341,0.692c0.192,0.111,0.438,0.168,0.731,0.168l0.481,0l0,4.362c0,0.277,0.026,0.533,0.081,0.768c0.056,0.246,0.154,0.464,0.298,0.645c0.146,0.186,0.345,0.332,0.595,0.436c0.241,0.098,0.555,0.146,0.93,0.146l0.896,0c0.292,0,0.539,-0.054,0.731,-0.166c0.154,-0.089,0.341,-0.281,0.341,-0.693c0,-0.338,-0.114,-0.578,-0.341,-0.709c-0.192,-0.109,-0.439,-0.168,-0.731,-0.168l-0.821,0c-0.138,0,-0.19,-0.019,-0.207,-0.024c-0.014,-0.034,-0.035,-0.103,-0.035,-0.231L138.83,200.589l1.465,0c0.295,0,0.541,-0.057,0.734,-0.168c0.152,-0.09,0.34,-0.28,0.34,-0.692C141.365,199.389,141.252,199.15,141.025,199.021z" fill="#8C8C8C" />
<path d="M132.57,198.851l-1.191,0c-0.292,0,-0.538,0.059,-0.731,0.169c-0.226,0.129,-0.341,0.368,-0.341,0.708c0,0.412,0.188,0.604,0.341,0.691c0.193,0.113,0.439,0.168,0.731,0.168l0.544,0l0,5.362c0,0.293,0.057,0.539,0.167,0.73c0.131,0.227,0.367,0.341,0.708,0.341c0.411,0,0.604,-0.187,0.692,-0.341c0.111,-0.191,0.168,-0.438,0.168,-0.73L133.658,199.939c0,-0.386,-0.084,-0.656,-0.256,-0.83C133.227,198.937,132.957,198.851,132.57,198.851z" fill="#8C8C8C" />
<path d="M128.735,199.021c-0.193,-0.111,-0.44,-0.169,-0.732,-0.169l-0.604,0c-0.25,0,-0.498,0.063,-0.734,0.187c-0.226,0.119,-0.433,0.271,-0.616,0.453l-0.644,0.604l0,-0.247c0,-0.291,-0.055,-0.538,-0.168,-0.729c-0.128,-0.228,-0.368,-0.34,-0.707,-0.34c-0.41,0,-0.604,0.184,-0.693,0.34c-0.11,0.191,-0.167,0.438,-0.167,0.729l0,4.801c-0.475,0.293,-0.791,0.816,-0.791,1.412c0,0.917,0.745,1.661,1.658,1.661c0.916,0,1.66,-0.744,1.66,-1.661c0,-0.596,-0.317,-1.119,-0.792,-1.412l0,-2.21l1.738,-1.564c0.1,-0.09,0.199,-0.164,0.297,-0.217c0.084,-0.045,0.174,-0.067,0.274,-0.067l0.288,0c0.292,0,0.539,-0.056,0.732,-0.169c0.155,-0.088,0.339,-0.279,0.339,-0.691C129.075,199.389,128.96,199.15,128.735,199.021zM124.536,206.664c-0.332,0,-0.603,-0.271,-0.603,-0.604c0,-0.333,0.271,-0.604,0.603,-0.604c0.333,0,0.604,0.271,0.604,0.604C125.14,206.395,124.869,206.664,124.536,206.664z" fill="#8C8C8C" />
<path d="M122.019,195.502c-0.193,-0.111,-0.44,-0.167,-0.731,-0.167l-0.59,0c-0.2,0,-0.389,0.004,-0.562,0.016c-0.176,0.009,-0.345,0.035,-0.506,0.07c-0.168,0.041,-0.336,0.109,-0.496,0.202c-0.158,0.093,-0.319,0.222,-0.48,0.382c-0.334,0.314,-0.554,0.656,-0.652,1.017c-0.094,0.348,-0.143,0.735,-0.143,1.151l0,0.678l-0.483,0c-0.292,0,-0.539,0.059,-0.73,0.169c-0.227,0.13,-0.342,0.369,-0.342,0.708c0,0.412,0.185,0.604,0.341,0.693c0.191,0.111,0.438,0.166,0.73,0.166l0.483,0l0,5.362c0,0.293,0.057,0.539,0.167,0.73c0.13,0.227,0.367,0.341,0.708,0.341c0.411,0,0.603,-0.187,0.692,-0.341c0.111,-0.191,0.168,-0.438,0.168,-0.73l0,-5.36l0.92,0c0.293,0,0.54,-0.057,0.732,-0.168c0.155,-0.09,0.34,-0.28,0.34,-0.692c0,-0.34,-0.114,-0.579,-0.34,-0.708c-0.189,-0.111,-0.436,-0.17,-0.729,-0.17l-0.92,0l0,-0.678c0,-0.218,0.019,-0.41,0.056,-0.571c0.032,-0.141,0.103,-0.261,0.218,-0.367l0.002,-0.004l0.002,-0.002c0.082,-0.082,0.176,-0.126,0.29,-0.136c0.15,-0.015,0.339,-0.022,0.564,-0.022l0.56,0c0.291,0,0.539,-0.058,0.731,-0.168c0.154,-0.088,0.339,-0.281,0.339,-0.693C122.359,195.871,122.244,195.632,122.019,195.502z" fill="#8C8C8C" />
<path d="M174.012,199.119c-0.089,-0.156,-0.282,-0.34,-0.693,-0.34c-0.339,0,-0.578,0.113,-0.707,0.34c-0.078,0.133,-0.127,0.293,-0.152,0.477l-0.021,-0.021c-0.216,-0.236,-0.466,-0.42,-0.747,-0.539c-0.277,-0.119,-0.563,-0.183,-0.849,-0.183l-0.709,0c-0.249,0,-0.466,0.015,-0.64,0.041c-0.182,0.026,-0.352,0.074,-0.51,0.14c-0.158,0.066,-0.313,0.15,-0.459,0.254c-0.139,0.097,-0.303,0.226,-0.486,0.377c-0.188,0.156,-0.342,0.302,-0.463,0.434c-0.127,0.141,-0.23,0.293,-0.306,0.455c-0.069,0.16,-0.122,0.337,-0.147,0.523c-0.026,0.178,-0.041,0.391,-0.041,0.631l0,2.386c0,0.24,0.015,0.451,0.041,0.631c0.025,0.188,0.078,0.361,0.147,0.521c0.074,0.164,0.179,0.318,0.306,0.457c0.119,0.129,0.274,0.274,0.463,0.433c0.186,0.153,0.35,0.28,0.486,0.379c0.146,0.103,0.299,0.188,0.459,0.254c0.158,0.065,0.329,0.112,0.51,0.14c0.174,0.026,0.389,0.039,0.64,0.039l0.709,0c0.298,0,0.591,-0.066,0.87,-0.199c0.244,-0.114,0.492,-0.291,0.73,-0.523l0,1.434c0,0.18,-0.025,0.334,-0.072,0.465c-0.043,0.119,-0.159,0.258,-0.344,0.406c-0.154,0.127,-0.309,0.217,-0.457,0.264c-0.15,0.049,-0.341,0.074,-0.563,0.074l-2.203,0c-0.293,0,-0.538,0.055,-0.732,0.166c-0.152,0.088,-0.34,0.282,-0.34,0.692c0,0.341,0.115,0.579,0.34,0.71c0.194,0.109,0.439,0.167,0.732,0.167l2.326,0c0.247,0,0.463,-0.015,0.638,-0.041c0.179,-0.026,0.351,-0.073,0.513,-0.14c0.153,-0.064,0.31,-0.15,0.455,-0.254c0.143,-0.101,0.305,-0.227,0.487,-0.379c0.185,-0.153,0.343,-0.299,0.463,-0.431c0.128,-0.141,0.229,-0.294,0.304,-0.456c0.071,-0.162,0.123,-0.338,0.148,-0.523c0.025,-0.182,0.041,-0.393,0.041,-0.631l0,-7.898C174.179,199.557,174.125,199.31,174.012,199.119zM172.443,203.579c0,0.188,-0.062,0.35,-0.188,0.49c-0.15,0.172,-0.394,0.403,-0.716,0.686l-0.002,0.003l-0.002,0.004c-0.139,0.13,-0.291,0.237,-0.453,0.325c-0.148,0.082,-0.325,0.121,-0.526,0.121L170.255,205.208c-0.222,0,-0.41,-0.021,-0.563,-0.072c-0.148,-0.049,-0.301,-0.137,-0.453,-0.264c-0.231,-0.186,-0.315,-0.322,-0.346,-0.404c-0.049,-0.131,-0.072,-0.285,-0.072,-0.465l0,-2.206c0,-0.18,0.023,-0.336,0.072,-0.467c0.029,-0.082,0.113,-0.217,0.346,-0.403c0.152,-0.127,0.305,-0.216,0.453,-0.265c0.153,-0.049,0.342,-0.072,0.563,-0.072l0.301,0c0.212,0,0.388,0.037,0.526,0.113c0.152,0.082,0.308,0.191,0.457,0.324c0.322,0.293,0.564,0.529,0.716,0.7c0.128,0.146,0.188,0.304,0.188,0.492L172.443,203.579z" fill="#8C8C8C" />
<path d="M154.033,194.359c-0.914,0,-1.66,0.745,-1.66,1.66c0,0.916,0.746,1.66,1.66,1.66s1.66,-0.744,1.66,-1.66C155.693,195.104,154.947,194.359,154.033,194.359zM154.033,196.622c-0.332,0,-0.604,-0.27,-0.604,-0.603s0.271,-0.603,0.604,-0.603s0.604,0.27,0.604,0.603C154.637,196.352,154.365,196.622,154.033,196.622z" fill="#8C8C8C" />
<path d="M164.719,204.627l-0.107,-3.419c-0.011,-0.178,-0.021,-0.338,-0.031,-0.489c-0.01,-0.162,-0.037,-0.322,-0.082,-0.476c-0.045,-0.158,-0.11,-0.309,-0.198,-0.453c-0.093,-0.146,-0.216,-0.289,-0.37,-0.42c-0.225,-0.192,-0.443,-0.334,-0.646,-0.416c-0.207,-0.084,-0.461,-0.127,-0.754,-0.127l-1.012,0c-0.259,0,-0.501,0.058,-0.716,0.164c-0.197,0.098,-0.39,0.203,-0.572,0.315l-0.003,0.002l-0.003,0.003l-0.837,0.555l0,-0.041c0,-0.291,-0.057,-0.539,-0.168,-0.733c-0.129,-0.226,-0.367,-0.339,-0.707,-0.339c-0.411,0,-0.604,0.185,-0.693,0.339c-0.109,0.194,-0.168,0.438,-0.168,0.733l0,6.099c0,0.295,0.059,0.539,0.168,0.734c0.09,0.153,0.282,0.338,0.693,0.338c0.34,0,0.578,-0.114,0.707,-0.338c0.111,-0.195,0.168,-0.439,0.168,-0.734L159.388,201.889l1.953,-1.215c0.04,-0.024,0.082,-0.048,0.121,-0.063c0.031,-0.016,0.07,-0.025,0.115,-0.031c0.049,-0.012,0.117,-0.016,0.195,-0.016l0.362,0c0.188,0,0.334,0.021,0.435,0.059c0.082,0.029,0.143,0.076,0.18,0.143c0.05,0.078,0.08,0.18,0.098,0.303c0.02,0.139,0.034,0.309,0.045,0.504l0.096,3.097c-0.457,0.297,-0.762,0.811,-0.762,1.394c0,0.917,0.746,1.661,1.66,1.661c0.916,0,1.66,-0.744,1.66,-1.661C165.545,205.452,165.212,204.914,164.719,204.627zM163.885,206.664c-0.334,0,-0.602,-0.271,-0.602,-0.604c0,-0.333,0.268,-0.604,0.602,-0.604c0.333,0,0.604,0.271,0.604,0.604C164.49,206.395,164.218,206.664,163.885,206.664z" fill="#8C8C8C" />
<path d="M154.096,198.851l-1.193,0c-0.293,0,-0.539,0.059,-0.731,0.169c-0.226,0.129,-0.341,0.368,-0.341,0.708c0,0.412,0.186,0.604,0.341,0.691c0.192,0.113,0.438,0.168,0.731,0.168l0.545,0l0,5.362c0,0.293,0.055,0.539,0.168,0.73c0.127,0.227,0.365,0.341,0.707,0.341c0.41,0,0.604,-0.187,0.691,-0.341c0.111,-0.191,0.17,-0.438,0.17,-0.73L155.184,199.939c0,-0.386,-0.085,-0.656,-0.259,-0.83C154.753,198.937,154.48,198.851,154.096,198.851z" fill="#8C8C8C" />
</g>
</g>
</g>
<g partID="64640">
<g transform="translate(115.743,59.2405)">
<g id="schematic">
<line fill="none" stroke="#000000" stroke-linecap="round" stroke-width="0.7" x1="19.8" x2="21.6" y1="11.159" y2="11.159"/>
<line fill="none" stroke="#000000" stroke-linecap="round" stroke-width="0.7" x1="7.2" x2="19.8" y1="11.159" y2="7.559"/>
<circle cx="7.2" cy="11.159" fill="none" r="0.36" stroke="#000000" stroke-width="0.7"/>
<circle cx="21.6" cy="11.159" fill="none" r="0.36" stroke="#000000" stroke-width="0.7"/>
<g transform="matrix(1, 0, 0, 1, 2.7612, 2.718)">
<text fill="#787878" font-family="'DroidSans'" font-size="2">1</text>
</g>
<g transform="matrix(1, 0, 0, 1, 24.604, 2.718)">
<text fill="#787878" font-family="'DroidSans'" font-size="2">2</text>
</g>
<g transform="matrix(1, 0, 0, 1, 2.7612, 16.843)">
<text fill="#787878" font-family="'DroidSans'" font-size="2">1</text>
</g>
<g transform="matrix(1, 0, 0, 1, 24.604, 16.843)">
<text fill="#787878" font-family="'DroidSans'" font-size="2">2</text>
</g>
<line fill="none" stroke="#000000" stroke-linecap="round" stroke-width="0.7" x1="21.6" x2="21.6" y1="3.96" y2="18.359"/>
<line fill="none" stroke="#000000" stroke-linecap="round" stroke-width="0.7" x1="7.2" x2="7.2" y1="3.96" y2="18.359"/>
<line fill="none" id="connector3pin" stroke="#555555" stroke-linecap="round" stroke-width="0.7" x1="0.322" x2="7.2" y1="18.359" y2="18.359"/>
<line fill="none" id="connector2pin" stroke="#555555" stroke-linecap="round" stroke-width="0.7" x1="0.322" x2="7.2" y1="3.96" y2="3.96"/>
<g fill="none" id="connector2terminal" points="0.822,4.281,0.837,3.64,0,3.64,0,4.281"/>
<g fill="none" id="connector3terminal" points="0.822,18.694,0.837,18.053,0,18.053,0,18.694"/>
<line fill="none" id="connector1pin" stroke="#555555" stroke-linecap="round" stroke-width="0.7" x1="28.451" x2="21.6" y1="18.359" y2="18.359"/>
<g fill="none" height="0.672" id="connector1terminal" width="0.994" x="27.806" y="18.006"/>
<g fill="none" height="0.719" id="connector0terminal" width="1.088" x="27.712" y="3.6"/>
<line fill="none" id="connector0pin" stroke="#555555" stroke-linecap="round" stroke-width="0.7" x1="28.451" x2="21.6" y1="3.96" y2="3.96"/>
</g>
</g>
</g>
<g partID="62440">
<g transform="translate(119.699,149.384)">
<g id="schematic">
<g>
<path d="M13.5,14.966L9.9,14.966c-0.193,0,-0.35,-0.156,-0.35,-0.35s0.156,-0.35,0.35,-0.35L13.5,14.266c0.193,0,0.35,0.156,0.35,0.35S13.694,14.966,13.5,14.966z"/>
</g>
<g>
<path d="M9.9,14.966L6.3,14.966c-0.193,0,-0.35,-0.156,-0.35,-0.35s0.157,-0.35,0.35,-0.35l3.6,0c0.193,0,0.35,0.156,0.35,0.35S10.093,14.966,9.9,14.966z"/>
</g>
<g>
<polygon fill="#FFFFFF" points="9.9,14.616,6.3,7.416,9.9,7.416,13.5,7.416"/>
<path d="M9.9,15.398L5.734,7.066l8.333,0L9.9,15.398zM6.866,7.766L9.9,13.834l3.034,-6.068L6.866,7.766z"/>
</g>
<g>
<path d="M9.9,14.841c-0.124,0,-0.225,-0.101,-0.225,-0.225l0,-7.2c0,-0.124,0.101,-0.225,0.225,-0.225s0.225,0.101,0.225,0.225l0,7.2C10.124,14.74,10.024,14.841,9.9,14.841z"/>
</g>
<g>
<path d="M1.8,12.141c-0.058,0,-0.115,-0.021,-0.159,-0.065c-0.088,-0.088,-0.088,-0.23,0,-0.318l2.34,-2.341c0.088,-0.088,0.23,-0.088,0.318,0s0.088,0.23,0,0.318l-2.34,2.341C1.915,12.12,1.858,12.141,1.8,12.141z"/>
</g>
<g>
<path d="M2.16,15.381c-0.058,0,-0.115,-0.021,-0.159,-0.065c-0.088,-0.088,-0.088,-0.23,0,-0.318l2.34,-2.34c0.088,-0.088,0.23,-0.088,0.318,0s0.088,0.23,0,0.318l-2.34,2.34C2.276,15.359,2.218,15.381,2.16,15.381z"/>
</g>
<g id="connector0pin">
<path d="M9.9,22.166c-0.193,0,-0.35,-0.156,-0.35,-0.35l0,-7.2c0,-0.193,0.156,-0.35,0.35,-0.35s0.35,0.156,0.35,0.35l0,7.2C10.249,22.01,10.093,22.166,9.9,22.166z" fill="#787878"/>
</g>
<g id="connector0terminal">
<rect fill="none" height="0.001" width="0.001" x="9.9" y="21.816"/>
</g>
<g transform="matrix(1, 0, 0, 1, 3.429, 6.4262)">
<g>
<g transform="rotate(270)">
<g>
<g enable-background="new ">
<path d="M-11.647,5.54l-0.891,0L-12.538,5.388l0.342,-0.372c0.049,-0.053,0.093,-0.101,0.131,-0.145s0.071,-0.086,0.099,-0.128c0.026,-0.042,0.047,-0.084,0.062,-0.125c0.015,-0.043,0.021,-0.088,0.021,-0.138c0,-0.038,-0.005,-0.072,-0.017,-0.102s-0.027,-0.054,-0.047,-0.075c-0.021,-0.02,-0.045,-0.035,-0.073,-0.046s-0.06,-0.016,-0.094,-0.016c-0.062,0,-0.118,0.013,-0.167,0.038c-0.051,0.024,-0.098,0.057,-0.143,0.096l-0.1,-0.116c0.025,-0.023,0.055,-0.046,0.084,-0.065c0.029,-0.021,0.063,-0.039,0.097,-0.054s0.071,-0.026,0.109,-0.036c0.038,-0.008,0.079,-0.013,0.121,-0.013c0.063,0,0.119,0.009,0.169,0.026c0.051,0.018,0.094,0.043,0.129,0.076c0.035,0.032,0.063,0.072,0.082,0.119c0.019,0.048,0.028,0.101,0.028,0.16c0,0.056,-0.009,0.108,-0.026,0.158c-0.017,0.05,-0.041,0.1,-0.07,0.148c-0.031,0.048,-0.066,0.097,-0.109,0.146c-0.041,0.049,-0.087,0.1,-0.136,0.152L-12.32,5.37l0,0.008l0.673,0L-11.647,5.54z" fill="#787878"/>
</g>
</g>
</g>
</g>
</g>
<g id="connector1pin">
<path d="M9.9,7.766c-0.193,0,-0.35,-0.157,-0.35,-0.35l0,-7.2c0,-0.193,0.156,-0.35,0.35,-0.35s0.35,0.157,0.35,0.35l0,7.2C10.249,7.609,10.093,7.766,9.9,7.766z" fill="#787878"/>
</g>
<g id="connector1terminal">
<polygon fill="none" points="9.9,0.216,9.901,0.216,9.901,0.216"/>
</g>
<g transform="matrix(1, 0, 0, 1, 3.429, 1.3462)">
<g>
<g transform="rotate(270)">
<g>
<g enable-background="new ">
<path d="M-2.616,5.54l-0.172,0L-2.788,4.648c0,-0.028,0,-0.058,0,-0.09s0.001,-0.063,0.002,-0.095c0.001,-0.032,0.002,-0.063,0.003,-0.092c0.001,-0.028,0.002,-0.054,0.002,-0.076c-0.011,0.012,-0.021,0.021,-0.029,0.03s-0.017,0.017,-0.026,0.024s-0.018,0.016,-0.028,0.025c-0.01,0.008,-0.021,0.019,-0.035,0.03l-0.145,0.118l-0.094,-0.12l0.374,-0.292l0.146,0L-2.618,5.54z" fill="#787878"/>
</g>
</g>
</g>
</g>
</g>
<g>
<path d="M0.18,13.536l1.08,-2.521l1.44,1.438L0.18,13.536z"/>
</g>
<g>
<path d="M0.54,16.776l1.08,-2.521l1.438,1.438L0.54,16.776z"/>
</g>
</g>
</g>
</g>
<g partID="58270">
<g transform="translate(0,5.6)">
<g id="schematic">
<rect fill="#FFFFFF" height="150.3" stroke="#000000" stroke-linecap="round" stroke-width="0.3175" width="78.3" x="14.85" y="14.85"/>
<line fill="none" id="connector61pin" stroke="#787878" stroke-linecap="round" stroke-width="0.2469" x1="93.25" x2="107.65" y1="28.8" y2="28.8"/>
<g transform="matrix(1, 0, 0, 1, 82.2441, 29.5)">
<text fill="#8C8C8C" font-family="'DroidSans'" font-size="3.5">D0/RX</text>
</g>
<g fill="none" height="0.7" id="connector61terminal" width="0.699" x="107.65" y="28.45"/>
<line fill="none" id="connector62pin" stroke="#787878" stroke-linecap="round" stroke-width="0.2469" x1="93.25" x2="107.65" y1="36" y2="36"/>
<g transform="matrix(1, 0, 0, 1, 82.4922, 36.6992)">
<text fill="#8C8C8C" font-family="'DroidSans'" font-size="3.5">D1/TX</text>
</g>
<g fill="none" height="0.7" id="connector62terminal" width="0.699" x="107.65" y="35.65"/>
<line fill="none" id="connector63pin" stroke="#787878" stroke-linecap="round" stroke-width="0.2469" x1="93.25" x2="107.65" y1="43.2" y2="43.2"/>
<g transform="matrix(1, 0, 0, 1, 87.5273, 43.9004)">
<text fill="#8C8C8C" font-family="'DroidSans'" font-size="3.5">D2</text>
</g>
<g fill="none" height="0.7" id="connector63terminal" width="0.699" x="107.65" y="42.85"/>
<line fill="none" id="connector64pin" stroke="#787878" stroke-linecap="round" stroke-width="0.2469" x1="93.25" x2="107.65" y1="50.4" y2="50.4"/>
<g transform="matrix(1, 0, 0, 1, 78.4629, 51.0996)">
<text fill="#8C8C8C" font-family="'DroidSans'" font-size="3.5">D3 PWM</text>
</g>
<g fill="none" height="0.7" id="connector64terminal" width="0.699" x="107.65" y="50.05"/>
<line fill="none" id="connector65pin" stroke="#787878" stroke-linecap="round" stroke-width="0.2469" x1="93.25" x2="107.65" y1="57.6" y2="57.6"/>
<g transform="matrix(1, 0, 0, 1, 87.5273, 58.3008)">
<text fill="#8C8C8C" font-family="'DroidSans'" font-size="3.5">D4</text>
</g>
<g fill="none" height="0.7" id="connector65terminal" width="0.699" x="107.65" y="57.25"/>
<line fill="none" id="connector66pin" stroke="#787878" stroke-linecap="round" stroke-width="0.2469" x1="93.25" x2="107.65" y1="64.8" y2="64.8"/>
<g transform="matrix(1, 0, 0, 1, 78.4629, 65.5)">
<text fill="#8C8C8C" font-family="'DroidSans'" font-size="3.5">D5 PWM</text>
</g>
<g fill="none" height="0.7" id="connector66terminal" width="0.699" x="107.65" y="64.45"/>
<line fill="none" id="connector67pin" stroke="#787878" stroke-linecap="round" stroke-width="0.2469" x1="93.25" x2="107.65" y1="72" y2="72"/>
<g transform="matrix(1, 0, 0, 1, 78.4629, 72.6992)">
<text fill="#8C8C8C" font-family="'DroidSans'" font-size="3.5">D6 PWM</text>
</g>
<g fill="none" height="0.7" id="connector67terminal" width="0.699" x="107.65" y="71.65"/>
<line fill="none" id="connector68pin" stroke="#787878" stroke-linecap="round" stroke-width="0.2469" x1="93.25" x2="107.65" y1="79.2" y2="79.2"/>
<g transform="matrix(1, 0, 0, 1, 87.5273, 79.9004)">
<text fill="#8C8C8C" font-family="'DroidSans'" font-size="3.5">D7</text>
</g>
<g fill="none" height="0.7" id="connector68terminal" width="0.699" x="107.65" y="78.85"/>
<line fill="none" id="connector51pin" stroke="#787878" stroke-linecap="round" stroke-width="0.2469" x1="93.25" x2="107.65" y1="86.4" y2="86.4"/>
<g transform="matrix(1, 0, 0, 1, 87.5273, 87.0996)">
<text fill="#8C8C8C" font-family="'DroidSans'" font-size="3.5">D8</text>
</g>
<g fill="none" height="0.7" id="connector51terminal" width="0.699" x="107.65" y="86.05"/>
<line fill="none" id="connector52pin" stroke="#787878" stroke-linecap="round" stroke-width="0.2469" x1="93.25" x2="107.65" y1="93.6" y2="93.6"/>
<g transform="matrix(1, 0, 0, 1, 78.4629, 94.3008)">
<text fill="#8C8C8C" font-family="'DroidSans'" font-size="3.5">D9 PWM</text>
</g>
<g fill="none" height="0.699" id="connector52terminal" width="0.699" x="107.65" y="93.25"/>
<line fill="none" id="connector53pin" stroke="#787878" stroke-linecap="round" stroke-width="0.2469" x1="93.25" x2="107.65" y1="100.8" y2="100.8"/>
<g transform="matrix(1, 0, 0, 1, 71.5977, 101.5)">
<text fill="#8C8C8C" font-family="'DroidSans'" font-size="3.5">D10 PWM/SS</text>
</g>
<g fill="none" height="0.701" id="connector53terminal" width="0.699" x="107.65" y="100.449"/>
<line fill="none" id="connector54pin" stroke="#787878" stroke-linecap="round" stroke-width="0.2469" x1="93.25" x2="107.65" y1="108" y2="108"/>
<g transform="matrix(1, 0, 0, 1, 66.584, 108.699)">
<text fill="#8C8C8C" font-family="'DroidSans'" font-size="3.5">D11 PWM/MOSI</text>
</g>
<g fill="none" height="0.699" id="connector54terminal" width="0.699" x="107.65" y="107.65"/>
<line fill="none" id="connector55pin" stroke="#787878" stroke-linecap="round" stroke-width="0.2469" x1="93.25" x2="107.65" y1="115.2" y2="115.2"/>
<g transform="matrix(1, 0, 0, 1, 75.6484, 115.9)">
<text fill="#8C8C8C" font-family="'DroidSans'" font-size="3.5">D12/MISO</text>
</g>
<g fill="none" height="0.7" id="connector55terminal" width="0.699" x="107.65" y="114.85"/>
<line fill="none" id="connector41pin" x1="93.25" x2="107.65" y1="122.4" y2="122.4"/>
<g fill="none" height="0.7" id="connector41terminal" width="0.699" x="107.65" y="122.05"/>
<line fill="none" id="connector56pin" stroke="#787878" stroke-linecap="round" stroke-width="0.2469" x1="93.25" x2="107.65" y1="122.4" y2="122.4"/>
<g transform="matrix(1, 0, 0, 1, 78.3398, 123.1)">
<text fill="#8C8C8C" font-family="'DroidSans'" font-size="3.5">D13/SCK</text>
</g>
<g fill="none" height="0.7" id="connector56terminal" width="0.699" x="107.65" y="122.05"/>
<line fill="none" id="connector45pin" stroke="#787878" stroke-linecap="round" stroke-width="0.2469" x1="93.25" x2="107.65" y1="136.8" y2="136.8"/>
<g transform="matrix(1, 0, 0, 1, 73.2715, 137.5)">
<text fill="#8C8C8C" font-family="'DroidSans'" font-size="3.5">ICSP2 MISO</text>
</g>
<g fill="none" height="0.7" id="connector45terminal" width="0.699" x="107.65" y="136.45"/>
<line fill="none" id="connector47pin" stroke="#787878" stroke-linecap="round" stroke-width="0.2469" x1="93.25" x2="107.65" y1="144" y2="144"/>
<g transform="matrix(1, 0, 0, 1, 75.9629, 144.699)">
<text fill="#8C8C8C" font-family="'DroidSans'" font-size="3.5">ICSP2 SCK</text>
</g>
<g fill="none" height="0.699" id="connector47terminal" width="0.699" x="107.65" y="143.65"/>
<line fill="none" id="connector48pin" stroke="#787878" stroke-linecap="round" stroke-width="0.2469" x1="93.25" x2="107.65" y1="151.2" y2="151.2"/>
<g transform="matrix(1, 0, 0, 1, 73.2715, 151.9)">
<text fill="#8C8C8C" font-family="'DroidSans'" font-size="3.5">ICSP2 MOSI</text>
</g>
<g fill="none" height="0.7" id="connector48terminal" width="0.699" x="107.65" y="150.85"/>
<line fill="none" id="connector43pin" x1="0.35" x2="14.75" y1="28.8" y2="28.8"/>
<g fill="none" height="0.7" id="connector43terminal" width="0.7" x="-0.35" y="28.45"/>
<line fill="none" id="connector85pin" stroke="#787878" stroke-linecap="round" stroke-width="0.2469" x1="0.35" x2="14.75" y1="28.8" y2="28.8"/>
<g transform="matrix(1, 0, 0, 1, 16.1504, 29.5)">
<text fill="#8C8C8C" font-family="'DroidSans'" font-size="3.5">RESET</text>
</g>
<g fill="none" height="0.7" id="connector85terminal" width="0.7" x="-0.35" y="28.45"/>
<line fill="none" id="connector49pin" stroke="#787878" stroke-linecap="round" stroke-width="0.2469" x1="0.35" x2="14.75" y1="36" y2="36"/>
<g transform="matrix(1, 0, 0, 1, 16.1504, 36.6992)">
<text fill="#8C8C8C" font-family="'DroidSans'" font-size="3.5">RESET2</text>
</g>
<g fill="none" height="0.7" id="connector49terminal" width="0.7" x="-0.35" y="35.65"/>
<line fill="none" id="connector58pin" stroke="#787878" stroke-linecap="round" stroke-width="0.2469" x1="0.35" x2="14.75" y1="43.2" y2="43.2"/>
<g transform="matrix(1, 0, 0, 1, 16.1504, 43.9004)">
<text fill="#8C8C8C" font-family="'DroidSans'" font-size="3.5">AREF</text>
</g>
<g fill="none" height="0.7" id="connector58terminal" width="0.7" x="-0.35" y="42.85"/>
<line fill="none" id="connector84pin" stroke="#787878" stroke-linecap="round" stroke-width="0.2469" x1="0.35" x2="14.75" y1="50.4" y2="50.4"/>
<g transform="matrix(1, 0, 0, 1, 16.1504, 51.0996)">
<text fill="#8C8C8C" font-family="'DroidSans'" font-size="3.5">IOREF</text>
</g>
<g fill="none" height="0.7" id="connector84terminal" width="0.7" x="-0.35" y="50.05"/>
<line fill="none" id="connector0pin" stroke="#787878" stroke-linecap="round" stroke-width="0.2469" x1="0.35" x2="14.75" y1="64.8" y2="64.8"/>
<g transform="matrix(1, 0, 0, 1, 16.1504, 65.5)">
<text fill="#8C8C8C" font-family="'DroidSans'" font-size="3.5">A0</text>
</g>
<g fill="none" height="0.7" id="connector0terminal" width="0.7" x="-0.35" y="64.45"/>
<line fill="none" id="connector1pin" stroke="#787878" stroke-linecap="round" stroke-width="0.2469" x1="0.35" x2="14.75" y1="72" y2="72"/>
<g transform="matrix(1, 0, 0, 1, 16.1504, 72.6992)">
<text fill="#8C8C8C" font-family="'DroidSans'" font-size="3.5">A1</text>
</g>
<g fill="none" height="0.7" id="connector1terminal" width="0.7" x="-0.35" y="71.65"/>
<line fill="none" id="connector2pin" stroke="#787878" stroke-linecap="round" stroke-width="0.2469" x1="0.35" x2="14.75" y1="79.2" y2="79.2"/>
<g transform="matrix(1, 0, 0, 1, 16.1504, 79.9004)">
<text fill="#8C8C8C" font-family="'DroidSans'" font-size="3.5">A2</text>
</g>
<g fill="none" height="0.7" id="connector2terminal" width="0.7" x="-0.35" y="78.85"/>
<line fill="none" id="connector3pin" stroke="#787878" stroke-linecap="round" stroke-width="0.2469" x1="0.35" x2="14.75" y1="86.4" y2="86.4"/>
<g transform="matrix(1, 0, 0, 1, 16.1504, 87.0996)">
<text fill="#8C8C8C" font-family="'DroidSans'" font-size="3.5">A3</text>
</g>
<g fill="none" height="0.7" id="connector3terminal" width="0.7" x="-0.35" y="86.05"/>
<line fill="none" id="connector39pin" x1="0.35" x2="14.75" y1="93.6" y2="93.6"/>
<g fill="none" height="0.699" id="connector39terminal" width="0.7" x="-0.35" y="93.25"/>
<line fill="none" id="connector42pin" stroke="#787878" stroke-linecap="round" stroke-width="0.2469" x1="107.65" x2="93.251" y1="108" y2="108"/>
<g fill="none" height="0.699" id="connector42terminal" width="0.701" x="107.65" y="107.65"/>
<line fill="none" id="connector4pin" x1="0.35" x2="14.75" y1="93.6" y2="93.6"/>
<g fill="none" height="0.699" id="connector4terminal" width="0.7" x="-0.35" y="93.25"/>
<line fill="none" id="connector59pin" stroke="#787878" stroke-linecap="round" stroke-width="0.2469" x1="0.35" x2="14.75" y1="93.6" y2="93.6"/>
<g transform="matrix(1, 0, 0, 1, 16.1504, 94.3008)">
<text fill="#8C8C8C" font-family="'DroidSans'" font-size="3.5">A4/SDA</text>
</g>
<g fill="none" height="0.699" id="connector59terminal" width="0.7" x="-0.35" y="93.25"/>
<line fill="none" id="connector5pin" x1="0.35" x2="14.75" y1="100.8" y2="100.8"/>
<g fill="none" height="0.701" id="connector5terminal" width="0.7" x="-0.35" y="100.449"/>
<line fill="none" id="connector60pin" stroke="#787878" stroke-linecap="round" stroke-width="0.2469" x1="0.35" x2="14.75" y1="100.8" y2="100.8"/>
<g transform="matrix(1, 0, 0, 1, 16.1504, 101.5)">
<text fill="#8C8C8C" font-family="'DroidSans'" font-size="3.5">A5/SCL</text>
</g>
<g fill="none" height="0.701" id="connector60terminal" width="0.7" x="-0.35" y="100.449"/>
<line fill="none" id="connector91pin" stroke="#787878" stroke-linecap="round" stroke-width="0.2469" x1="0.35" x2="14.75" y1="136.8" y2="136.8"/>
<g transform="matrix(1, 0, 0, 1, 16.1504, 137.5)">
<text fill="#8C8C8C" font-family="'DroidSans'" font-size="3.5">N/C</text>
</g>
<g fill="none" height="0.7" id="connector91terminal" width="0.7" x="-0.35" y="136.45"/>
<line fill="none" id="connector88pin" x1="57.6" x2="57.6" y1="165.25" y2="179.65"/>
<g fill="none" height="0.699" id="connector88terminal" width="0.699" x="57.25" y="179.65"/>
<line fill="none" id="connector57pin" x1="57.6" x2="57.6" y1="165.25" y2="179.65"/>
<g fill="none" height="0.699" id="connector57terminal" width="0.699" x="57.25" y="179.65"/>
<line fill="none" id="connector44pin" x1="57.6" x2="57.6" y1="165.25" y2="179.65"/>
<g fill="none" height="0.699" id="connector44terminal" width="0.699" x="57.25" y="179.65"/>
<line fill="none" id="connector50pin" x1="57.6" x2="57.6" y1="165.25" y2="179.65"/>
<g fill="none" height="0.699" id="connector50terminal" width="0.699" x="57.25" y="179.65"/>
<line fill="none" id="connector89pin" stroke="#787878" stroke-linecap="round" stroke-width="0.2469" x1="57.6" x2="57.6" y1="165.25" y2="179.65"/>
<g transform="matrix(1, 0, 0, 1, 20.5669, 57.8026)">
<g>
<g transform="rotate(270)">
<g>
<g transform="matrix(1, 0, 0, 1, -106.047, 37.7339)">
<text fill="#8C8C8C" font-family="'DroidSans'" font-size="3.5">GND</text>
</g>
</g>
</g>
</g>
</g>
<g fill="none" height="0.699" id="connector89terminal" width="0.699" x="57.25" y="179.65"/>
<line fill="none" id="connector86pin" stroke="#787878" stroke-linecap="round" stroke-width="0.2469" x1="36" x2="36" y1="0.35" y2="14.75"/>
<g transform="matrix(1, 0, 0, 1, 12.9469, 5.69736)">
<g>
<g transform="rotate(270)">
<g>
<g transform="matrix(1, 0, 0, 1, -16.2948, 23.7523)">
<text fill="#8C8C8C" font-family="'DroidSans'" font-size="3.5">3V3</text>
</g>
</g>
</g>
</g>
</g>
<g fill="none" height="0.7" id="connector86terminal" width="0.7" x="35.65" y="-0.35"/>
<line fill="none" id="connector40pin" x1="50.4" x2="50.4" y1="0.35" y2="14.75"/>
<g fill="none" height="0.7" id="connector40terminal" width="0.7" x="50.05" y="-0.35"/>
<line fill="none" id="connector46pin" x1="50.4" x2="50.4" y1="0.35" y2="14.75"/>
<g fill="none" height="0.7" id="connector46terminal" width="0.7" x="50.05" y="-0.35"/>
<line fill="none" id="connector87pin" stroke="#787878" stroke-linecap="round" stroke-width="0.2469" x1="50.4" x2="50.4" y1="0.35" y2="14.75"/>
<g transform="matrix(1, 0, 0, 1, 18.0269, 5.69736)">
<g>
<g transform="rotate(270)">
<g>
<g transform="matrix(1, 0, 0, 1, -14.3671, 33.0727)">
<text fill="#8C8C8C" font-family="'DroidSans'" font-size="3.5">5V</text>
</g>
</g>
</g>
</g>
</g>
<g fill="none" height="0.7" id="connector87terminal" width="0.7" x="50.05" y="-0.35"/>
<line fill="none" id="connector90pin" stroke="#787878" stroke-linecap="round" stroke-width="0.2469" x1="64.8" x2="64.8" y1="0.35" y2="14.75"/>
<g transform="matrix(1, 0, 0, 1, 23.1069, 5.69736)">
<g>
<g transform="rotate(270)">
<g>
<g transform="matrix(1, 0, 0, 1, -16.1776, 42.3931)">
<text fill="#8C8C8C" font-family="'DroidSans'" font-size="3.5">VIN</text>
</g>
</g>
</g>
</g>
</g>
<g fill="none" height="0.7" id="connector90terminal" width="0.701" x="64.449" y="-0.35"/>
<g transform="matrix(1, 0, 0, 1, 46.7871, 81.3828)">
<text font-family="'DroidSans'" font-size="4.25" id="label">Arduino</text>
</g>
<g transform="matrix(1, 0, 0, 1, 50.4883, 85.916)">
<text font-family="'DroidSans'" font-size="4.25" id="label_1_">Uno</text>
</g>
<g transform="matrix(1, 0, 0, 1, 48.5938, 90.4492)">
<text font-family="'DroidSans'" font-size="4.25" id="label_2_">(Rev3)</text>
</g>
<g transform="matrix(1, 0, 0, 1, 50.1426, 94.9844)">
<text font-family="'DroidSans'" font-size="4.25" id="label_3_">ICSP</text>
</g>
</g>
</g>
</g>
<g partID="62640">
<g transform="translate(126.503,135.55)">
<g transform="matrix(0,-1,1,0,0,0)">
<g id="schematic" >
<line class="other" stroke="#000000" stroke-linecap="round" stroke-width="0.432002" x1="7.55002" x2="8.63003" y1="3.096" y2="0.216"/>
<line class="other" stroke="#000000" stroke-linecap="round" stroke-width="0.432002" x1="8.63003" x2="10.43" y1="0.216" y2="5.976"/>
<line class="other" stroke="#000000" stroke-linecap="round" stroke-width="0.432002" x1="10.43" x2="12.23" y1="5.976" y2="0.216"/>
<line class="other" stroke="#000000" stroke-linecap="round" stroke-width="0.432002" x1="12.23" x2="14.03" y1="0.216" y2="5.976"/>
<line class="other" stroke="#000000" stroke-linecap="round" stroke-width="0.432002" x1="14.03" x2="15.8301" y1="5.976" y2="0.216"/>
<line class="other" stroke="#000000" stroke-linecap="round" stroke-width="0.432002" x1="15.8301" x2="17.6301" y1="0.216" y2="5.976"/>
<line class="other" stroke="#000000" stroke-linecap="round" stroke-width="0.432002" x1="17.6301" x2="19.4301" y1="5.976" y2="0.216"/>
<line class="other" stroke="#000000" stroke-linecap="round" stroke-width="0.432002" x1="19.4301" x2="21.2301" y1="0.216" y2="5.976"/>
<line class="other" stroke="#000000" stroke-linecap="round" stroke-width="0.432002" x1="21.2301" x2="21.9501" y1="5.976" y2="3.096"/>
<line class="pin" connectorname="2" id="connector1pin" stroke="#787878" stroke-linecap="round" stroke-width="0.700001" x1="29.1502" x2="21.9501" y1="3.096" y2="3.096"/>
<g class="terminal" fill="none" height="0.000283465" id="connector1terminal" stroke="none" stroke-width="0" width="0.000283466" x="29.1502" y="3.096"/>
<text class="text" fill="#8c8c8c" font-family="'Droid Sans'" font-size="2.50001" stroke="none" stroke-width="0" text-anchor="middle" x="25.5501" y="2.046">2</text>
<line class="pin" connectorname="1" id="connector0pin" stroke="#787878" stroke-linecap="round" stroke-width="0.700001" x1="0.350001" x2="7.55002" y1="3.096" y2="3.096"/>
<g class="terminal" fill="none" height="0.000283465" id="connector0terminal" stroke="none" stroke-width="0" width="0.000283466" x="0.350001" y="3.096"/>
<text class="text" fill="#8c8c8c" font-family="'Droid Sans'" font-size="2.50001" stroke="none" stroke-width="0" text-anchor="middle" x="3.95001" y="2.046">1</text>
</g>
</g>
</g>
</g>
<g partID="65290">
<line stroke="#157de6" stroke-linecap="round" stroke-width="0.4" x1="129.599" x2="108" y1="106.4" y2="128"/>
</g>
<g partID="65370">
<line stroke="#25cc35" stroke-linecap="round" stroke-width="0.4" x1="129.599" x2="129.599" y1="149.6" y2="135.2"/>
</g>
<g partID="65550">
<line stroke="#00a527" stroke-linecap="round" stroke-width="0.4" x1="116.162" x2="108" y1="77.614" y2="120.8"/>
</g>
<g partID="65740">
<line stroke="#000000" stroke-linecap="round" stroke-width="0.4" x1="57.5995" x2="129.599" y1="185.6" y2="171.2"/>
</g>
<g partID="65590">
<line stroke="#404040" stroke-linecap="round" stroke-width="0.699998" x1="170.841" x2="129.599" y1="160.042" y2="171.2"/>
</g>
<circle cx="170.841" cy="160.042" fill="black" r="0.72" stroke="none" stroke-width="0"/>
<g partID="65710">
<line stroke="#404040" stroke-linecap="round" stroke-width="0.699998" x1="158.467" x2="170.841" y1="84.8351" y2="160.042"/>
</g>
<circle cx="158.467" cy="84.8351" fill="black" r="0.72" stroke="none" stroke-width="0"/>
<circle cx="170.841" cy="160.042" fill="black" r="0.72" stroke="none" stroke-width="0"/>
<g partID="65600">
<line stroke="#404040" stroke-linecap="round" stroke-width="0.699998" x1="144.046" x2="158.467" y1="77.5825" y2="84.8351"/>
</g>
<circle cx="158.467" cy="84.8351" fill="black" r="0.72" stroke="none" stroke-width="0"/>
<g id="partLabel" partID="58270">
<g transform="translate(108,0)">
<g fill="#000000" fill-opacity="1" font-family="'DroidSans'" font-size="5.000" font-style="normal" font-weight="normal" id="schematicLabel" stroke="none">
<text x="0" y="5.000">Part1</text>
</g>
</g>
</g>
<g id="partLabel" partID="62440">
<g transform="translate(133.379,138.184)">
<g fill="#000000" fill-opacity="1" font-family="'DroidSans'" font-size="5.000" font-style="normal" font-weight="normal" id="schematicLabel" stroke="none">
<text x="0" y="5.000">LED1</text>
<text x="0" y="10.000">Red (633nm)</text>
</g>
</g>
</g>
<g id="partLabel" partID="62640">
<g transform="translate(144.349,101.704)">
<g fill="#000000" fill-opacity="1" font-family="'DroidSans'" font-size="5.000" font-style="normal" font-weight="normal" id="schematicLabel" stroke="none">
<text x="0" y="5.000">R1</text>
<text x="0" y="10.000">220&#x3a9;</text>
<text x="0" y="15.000">&#xb1;5%</text>
</g>
</g>
</g>
<g id="partLabel" partID="64640">
<g transform="translate(144.543,53.6405)">
<g fill="#000000" fill-opacity="1" font-family="'DroidSans'" font-size="5.000" font-style="normal" font-weight="normal" id="schematicLabel" stroke="none">
<text x="0" y="5.000">S1</text>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 36 KiB

View File

@ -1,3 +1,8 @@
// Arduino Grundkurs des Z-Lab Bruchsal.
// Dies ist Übung 6: Ein Schalter
// Eine ausführliche Beschreibung mit Erklärungen findest du hier:
// https://git.digital-infinity.de/DigitalInfinity/Z-Lab/src/branch/main/Arduino_Grundlagen/06_Schalter
// Dort findest du auch eine Skizze für die Verkabelung
const int buttonPin = 12;
const int ledPin = 13;

View File

Before

Width:  |  Height:  |  Size: 367 KiB

After

Width:  |  Height:  |  Size: 367 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

View File

@ -0,0 +1,103 @@
TODO: Überarbeiten
# Z-Lab Arduino-Grundkurs Übung 6: Ein Schalter (ein digitaler Sensor)
In dieser Übung verwenden wir einen Schalter.
Zuerst öffnen wir das Projekt über den gewohnten Weg. Der Name ist "05_Schalter"
![Projekt öffnen](projekt_oeffnen.png)
## Verkabeln wir den Piepser mit dem Arduino mit dem Arduino
So muss da aussehen, wenn wir fertig sind:
<img src="06_Schalter.svg">
So und dann geht's wieder ans Programmieren.
In der Datei 06_Schalter.ino finden wir (ohne die ganzen Kommentare) folgenden Quellcode:
```c
const int buttonPin = 12;
const int ledPin = 13;
int buttonState = 0;
void setup() {
pinMode(ledPin, OUTPUT);
pinMode(buttonPin, INPUT);
}
void loop() {
buttonState = digitalRead(buttonPin);
if (buttonState == HIGH) {
digitalWrite(ledPin, HIGH);
} else {
digitalWrite(ledPin, LOW);
}
}
```
Auch hier hast du das meiste schon gesehen.
Wir haben hier aber unsere erste sogenannte Kontrollstruktur.
Kontrollstrukturen sorgen dafür, dass Programme unter bestimmten Bedingungen nur bestimmte Dinge machen oder oder nicht machen.
Wir erklären das gleich ganz genau :)
## digitalRead()
```c
buttonState = digitalRead(buttonPin);
```
Die Funktion digitalRead() liest einen digitalen Sensor aus.
Ein Schalter wie in unserem Beispiel gibt nur die 0 zurück, wenn er nicht gedrückt ist oder gibt die 1 zurück, wenn er gedrückt ist.
Dazwischen gibt es nicht.
Damit wir gleich wissen, ob der Knopf gedrückt ist oder nicht speichern wir das Ergebnis in der Variable "buttonState" ab, also Schalterstatus.
## if else (und elseif)
Jetzt verwenden wir die Variable "buttonState" und schauchen, ob der Knopf gedrückt ist.
Dazu gibt es if, else und (wird hier nicht verwendet elseif):
```c
if (buttonState == HIGH) {
digitalWrite(ledPin, HIGH);
} else {
digitalWrite(ledPin, LOW);
}
}
```
"if" heißt "wenn". Wenn also der buttonStage "HIGH" wie "an" ist dann soll das gemacht werden, was zwischen den geschwungenen Klammern steht, also die LED soll eingeschaltet werden.
"else", also "ansonsten" soll das gemacht werden, was in der zweiten Klammer steht.
Es gibt auch noch "elseif", das heißt so viel wie "ansonsten wenn".
Um Dinge zu vergleichen gibt es viele verschiedene Möglichkeiten, sogenannte Operatoren.
Mit diesen kannst du z.B. schauen, ob irgendwas gleich, ungleich, größer oder kleiner als etwas anderes ist.
Hier sind ein paar dieser Operatoren:
* "==" prüft, ob etwas gleich ist
* "!=" prüft, ob etwas ungleich ist
* "<" prüft, ob der Wert links kleiner ist als der Wert rechts
* ">" prüft, ob der Wert links größer ist als der Wert rechts
* "<=" prüft, ob der Wert links kleiner oder gleich dem Wert rechts ist
* ">=" prüft, ob der Wert links größer oder gleich dem Wert rechts ist
## Und wie könnte es weiter gehen?
* Kannst du das Programm auch so abändern, dass die LED 5 Sekunden an bleibt, wenn der Knopf gedrückt wird?
<details>
<summary>Hier klicken für Lösungsvorschläge - aber bitte erst selbst probieren! </summary>
```c
if (buttonState == HIGH) {
digitalWrite(ledPin, HIGH);
delay(5000);
} else {
digitalWrite(ledPin, LOW);
}
}
```
</details>