Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0993aaeac0 | ||
|
|
7961afba66 | ||
|
|
6e9d78b1d4 | ||
|
|
dabdb3425d | ||
|
|
85505cc5a5 | ||
|
|
7928400cb1 | ||
|
|
d8238bc47b | ||
|
|
280c8533e5 | ||
|
|
203df9984e | ||
|
|
fc8b3b6a72 | ||
|
|
cbcc2eeddc |
No files matched your search
@@ -1,3 +1,9 @@
|
|||||||
|
// Arduino Grundkurs des Z-Lab Bruchsal.
|
||||||
|
// Dies ist Übung 1: Grundstruktur/Nichts tun
|
||||||
|
// Eine ausführliche Beschreibung mit Erklärungen findest du hier:
|
||||||
|
// https://git.digital-infinity.de/DigitalInfinity/Z-Lab/src/branch/main/Arduino_Grundlagen/01_Grundstruktur
|
||||||
|
|
||||||
|
|
||||||
// Die Funktion (Aufgabe) "Setup" wird beim Start des Arduinos einmal ausgeführt
|
// Die Funktion (Aufgabe) "Setup" wird beim Start des Arduinos einmal ausgeführt
|
||||||
void setup() {
|
void setup() {
|
||||||
//Hier stehen dann die Befehle (was ist zu tun),
|
//Hier stehen dann die Befehle (was ist zu tun),
|
||||||
@@ -12,8 +18,5 @@ void loop() {
|
|||||||
|
|
||||||
//Dieses Beispiel tut...?
|
//Dieses Beispiel tut...?
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Absolut gar nichts.
|
//Absolut gar nichts.
|
||||||
//Probier es aus!
|
//Probier es aus!
|
||||||
|
After Width: | Height: | Size: 218 KiB |
|
After Width: | Height: | Size: 49 KiB |
@@ -76,11 +76,20 @@ void loop() {
|
|||||||
|
|
||||||
Unser Programm tut also gar nichts... Das ist aber nicht schlimm, denn wir schicken das trotzdem mal an den Arduino, um zu lernen, wie das geht und zu überprüfen, ob das denn auch stimmt.
|
Unser Programm tut also gar nichts... Das ist aber nicht schlimm, denn wir schicken das trotzdem mal an den Arduino, um zu lernen, wie das geht und zu überprüfen, ob das denn auch stimmt.
|
||||||
|
|
||||||
|
Damit wir das Programm auf den Arduino laden können müssen wir den Arduino an den PC anschließen.
|
||||||
|
Zudem muss die Arduino-IDE wissen, welchen Arduino wir verwenden.
|
||||||
|
Schließe den Arduino mit dem USB-Kabel an den PC an:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Um der Arduino-IDE zu sagen, welchen Arduino du hast wähle oben aus dem Drop-Down den eben angeschlossenen Arduino aus:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
Dazu drücken wir in der Arduino-IDE oben auf den Knopf oben links, auf dem ein Haken ist. Wenn du mit der Maus drüber fährst dann erscheint da ein "Überprüfen" als sog. "Tooltip":
|
Dazu drücken wir in der Arduino-IDE oben auf den Knopf oben links, auf dem ein Haken ist. Wenn du mit der Maus drüber fährst dann erscheint da ein "Überprüfen" als sog. "Tooltip":
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Dadurch wird das Programm, das wir offen haben vom Compiler überprüft und kompiliert. Wenn dieser keinen Fehler feststellt erscheinten unten link kurz "Kompilieren Erolgreich!". Das sieht dann so aus:
|
Dadurch wird das Programm, das wir offen haben vom Compiler überprüft und kompiliert. Wenn dieser keinen Fehler feststellt erscheinten unten link kurz "Kompilieren Erolgreich!". Das sieht dann so aus:
|
||||||
|
|
||||||

|

|
||||||
|
|||||||
@@ -1,10 +1,30 @@
|
|||||||
|
// Arduino Grundkurs des Z-Lab Bruchsal.
|
||||||
|
// Dies ist Übung 2: Blinken
|
||||||
|
// Eine ausführliche Beschreibung mit Erklärungen findest du hier:
|
||||||
|
// https://git.digital-infinity.de/DigitalInfinity/Z-Lab/src/branch/main/Arduino_Grundlagen/02_Blinken
|
||||||
|
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
|
// Der PIN-Mode legt fest, ob ein Anschluss des Arduino als Eingabe oder Ausgabe verwendert werden soll
|
||||||
|
// OUTPUT steht für Ausgabe, INPUT wäre Eingabe
|
||||||
|
// Mit LED_BUILTIN sagen wir, dass die LED, die fest auf dem Arduino installiert ist, verwendet werden soll
|
||||||
pinMode(LED_BUILTIN, OUTPUT);
|
pinMode(LED_BUILTIN, OUTPUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
|
// digitalWrite schreibt einen Wert auf einen Anschluss.
|
||||||
|
// Damit lässt sich z.B. etwas (wie bei uns eine LED) ein- oder ausschalten
|
||||||
|
// Hinter "HIGH" versteckt sich die 1, damit lässt sich die LED einschalten
|
||||||
digitalWrite(LED_BUILTIN, HIGH);
|
digitalWrite(LED_BUILTIN, HIGH);
|
||||||
|
// delay verzögert das Programm um eine bestimmte Zeit (Milisekunden)
|
||||||
|
// Danach gehts einfach weiter
|
||||||
delay(1000);
|
delay(1000);
|
||||||
|
// und wieder digitalWrite.
|
||||||
|
// Dieses Mal schalten wir die LED aus
|
||||||
digitalWrite(LED_BUILTIN, LOW);
|
digitalWrite(LED_BUILTIN, LOW);
|
||||||
|
// Und dann warten wir wieder eine Sekunde, bevor es neu los geht
|
||||||
delay(1000);
|
delay(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Was muss denn nun gemacht werden, damit die LED schneller oder langsamer blinkt?
|
||||||
|
// Wie müsste das Programm aussehen, damit die LED zweimal kurz und einmal lang leuchtet?
|
||||||
@@ -1,3 +1,13 @@
|
|||||||
|
// Arduino Grundkurs des Z-Lab Bruchsal.
|
||||||
|
// Dies ist Übung 3: Externe LED
|
||||||
|
// Eine ausführliche Beschreibung mit Erklärungen findest du hier:
|
||||||
|
// https://git.digital-infinity.de/DigitalInfinity/Z-Lab/src/branch/main/Arduino_Grundlagen/03_Externe_LED
|
||||||
|
// Dort findest du auch eine Skizze für die Verkabelung
|
||||||
|
|
||||||
|
// Anders als bei den bisherigen Programmen gibt es jetzt keine Lösung sondern du musst die Lösung selbst finden.
|
||||||
|
// Wie muss das Programm geändert werden, damit die LED, die nun ja an PIN 12 angeschlossen ist, blinkt?
|
||||||
|
// Wenn du gar keine Idee hast oder es einfach nicht klappen will dann findest du Lösungsvorschläge am Ende der ausführlichen Beschreibung
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
pinMode(LED_BUILTIN, OUTPUT);
|
pinMode(LED_BUILTIN, OUTPUT);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,376 +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.9245in" version="1.2" viewBox="0 0 202.978 210.564" width="2.81914in" x="0in" xmlns:svg="http://www.w3.org/2000/svg" y="0in">
|
|
||||||
<g id="watermark" >
|
|
||||||
<g >
|
|
||||||
<g >
|
|
||||||
<path d="M178.246,204.364c-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.661C179.905,205.109,179.16,204.364,178.246,204.364zM178.246,206.627c-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.604C178.849,206.358,178.578,206.627,178.246,206.627z" fill="#8C8C8C" />
|
|
||||||
<path d="M161.303,194.322c-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.66C162.963,195.067,162.219,194.322,161.303,194.322zM161.304,196.585c-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.603S161.635,196.585,161.304,196.585z" fill="#8C8C8C" />
|
|
||||||
<path d="M169.824,198.984c-0.193,-0.111,-0.439,-0.169,-0.732,-0.169l-1.465,0L167.627,196.293c0,-0.292,-0.057,-0.538,-0.166,-0.729C167.371,195.407,167.178,195.222,166.768,195.222c-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.231L167.629,200.552l1.465,0c0.295,0,0.541,-0.057,0.734,-0.168c0.152,-0.09,0.34,-0.28,0.34,-0.692C170.164,199.352,170.051,199.113,169.824,198.984z" fill="#8C8C8C" />
|
|
||||||
<path d="M161.369,198.814l-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.73L162.457,199.902c0,-0.386,-0.084,-0.656,-0.256,-0.83C162.026,198.9,161.756,198.814,161.369,198.814z" fill="#8C8C8C" />
|
|
||||||
<path d="M157.534,198.984c-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.691C157.874,199.352,157.759,199.113,157.534,198.984zM153.335,206.627c-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.604C153.939,206.358,153.668,206.627,153.335,206.627z" fill="#8C8C8C" />
|
|
||||||
<path d="M150.818,195.465c-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.693C151.158,195.834,151.043,195.595,150.818,195.465z" fill="#8C8C8C" />
|
|
||||||
<path d="M202.811,199.082c-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.898C202.978,199.52,202.924,199.273,202.811,199.082zM201.242,203.542c0,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.121L199.054,205.171c-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.492L201.242,203.542z" fill="#8C8C8C" />
|
|
||||||
<path d="M182.832,194.322c-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.66C184.492,195.067,183.746,194.322,182.832,194.322zM182.832,196.585c-0.332,0,-0.604,-0.27,-0.604,-0.603s0.271,-0.603,0.604,-0.603s0.604,0.27,0.604,0.603C183.436,196.315,183.164,196.585,182.832,196.585z" fill="#8C8C8C" />
|
|
||||||
<path d="M193.518,204.59l-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.734L188.187,201.852l1.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.661C194.344,205.415,194.011,204.877,193.518,204.59zM192.684,206.627c-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.604C193.289,206.358,193.017,206.627,192.684,206.627z" fill="#8C8C8C" />
|
|
||||||
<path d="M182.895,198.814l-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.73L183.983,199.902c0,-0.386,-0.085,-0.656,-0.259,-0.83C183.552,198.9,183.279,198.814,182.895,198.814z" fill="#8C8C8C" />
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
<g partID="62440">
|
|
||||||
<g transform="translate(148.498,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(155.303,128.35)">
|
|
||||||
<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="64930">
|
|
||||||
<line stroke="#000000" stroke-linecap="round" stroke-width="0.4" x1="158.399" x2="57.5995" y1="171.2" y2="185.6"/>
|
|
||||||
</g>
|
|
||||||
<g partID="64970">
|
|
||||||
<line stroke="#fa50e6" stroke-linecap="round" stroke-width="0.4" x1="158.399" x2="158.399" y1="149.6" y2="128"/>
|
|
||||||
</g>
|
|
||||||
<g partID="64990">
|
|
||||||
<line stroke="#8c3b00" stroke-linecap="round" stroke-width="0.4" x1="158.399" x2="108" y1="99.2" y2="128"/>
|
|
||||||
</g>
|
|
||||||
<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(162.178,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(173.149,94.5043)">
|
|
||||||
<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Ω</text>
|
|
||||||
<text x="0" y="15.000">±5%</text>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 112 KiB |
|
After Width: | Height: | Size: 239 KiB |
|
After Width: | Height: | Size: 267 KiB |
@@ -5,7 +5,7 @@ Allerdings dieses Mal eine externe.
|
|||||||
|
|
||||||
Zuerst öffnen wir das Projekt über den gewohnten Weg. Der Name ist "03_Externe_LED"
|
Zuerst öffnen wir das Projekt über den gewohnten Weg. Der Name ist "03_Externe_LED"
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Wenn du dieses Projekt öffnest wunderst du dich bestimmt. Das sieht ja genau so aus wie beim letzten Mal.
|
Wenn du dieses Projekt öffnest wunderst du dich bestimmt. Das sieht ja genau so aus wie beim letzten Mal.
|
||||||
|
|
||||||
@@ -18,17 +18,9 @@ Und wir müssen lernen, was ein Breadboard ist :)
|
|||||||
Ein Breadboard ist eine Steckplatine, die es uns erstpart alles, was wir mal testen wollen, löten zu müssen.
|
Ein Breadboard ist eine Steckplatine, die es uns erstpart alles, was wir mal testen wollen, löten zu müssen.
|
||||||
Dabei sind die Löcher an der Außenseite der Platine längs miteinander verbunden und die Löcher im Inneren der Platine sind quer miteinander verbunden:
|
Dabei sind die Löcher an der Außenseite der Platine längs miteinander verbunden und die Löcher im Inneren der Platine sind quer miteinander verbunden:
|
||||||
|
|
||||||
//TODO: BILD
|

|
||||||
|
|
||||||
Wenn wir nun einen Stromkreis brauchen, der eine LED, einen Widerstand und den Arduino miteinander verbindet dann müssten wir ohne das Breadboard einen Stromkreis basteln, der so aussieht:
|
Wenn wir nun aber ein paar Sachen hintereinander ausprobieren möchten müssten wir ja immer wieder neu umlöten. Das macht auf Dauer keinen Spaß. Deshalb gibt es die Breadboards. Damit lässt sich ein Stromkreis oder eine Schaltung leicht und ohne Werkzeug bauen und wieder verändern.
|
||||||
|
|
||||||
//TODO: BILD
|
|
||||||
|
|
||||||
Oder wir löten auf einer normalen Platine einen Stromkreis wie diesen hier:
|
|
||||||
|
|
||||||
//TODO: BILD
|
|
||||||
|
|
||||||
Wenn wir nun aber ein paar Sachen hintereinander ausprobieren möchten müssten wir ja immer wieder umbasteln oder umlöten. Das macht auf Dauer keinen Spaß. Deshalb gibt es die Breadboards. Damit lässt sich ein Stromkreis oder eine Schaltung leicht und ohne Werkzeug bauen und wieder verändern.
|
|
||||||
|
|
||||||
## Verkabeln wir also die LED mit dem Widerstand mit dem Arduino
|
## Verkabeln wir also die LED mit dem Widerstand mit dem Arduino
|
||||||
|
|
||||||
@@ -47,6 +39,10 @@ Für den Aufbau gehen wir wie folgt vor:
|
|||||||
Dazu stecken wir eine Seite eines schwarzen Kabels an einen der GND-Eingänge des Arduino.
|
Dazu stecken wir eine Seite eines schwarzen Kabels an einen der GND-Eingänge des Arduino.
|
||||||
Die andere Seite stecken wir in die Spalte, in der das kurze Beinchen der LED noch alleine Steck.
|
Die andere Seite stecken wir in die Spalte, in der das kurze Beinchen der LED noch alleine Steck.
|
||||||
|
|
||||||
|
Wenn alles fertig ist sieht das in etwa so aus:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
So und dann geht's wieder ans Programmieren.
|
So und dann geht's wieder ans Programmieren.
|
||||||
|
|
||||||
* Wie müssen wir den Code anpassen, damit die externe LED blinkt?
|
* Wie müssen wir den Code anpassen, damit die externe LED blinkt?
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
// Arduino Grundkurs des Z-Lab Bruchsal.
|
||||||
|
// Dies ist Übung 4: Ein Piepser
|
||||||
|
// Eine ausführliche Beschreibung mit Erklärungen findest du hier:
|
||||||
|
// https://git.digital-infinity.de/DigitalInfinity/Z-Lab/src/branch/main/Arduino_Grundlagen/04_Piepser
|
||||||
|
// Dort findest du auch eine Skizze für die Verkabelung
|
||||||
|
|
||||||
|
// Den Piepser schließen wir an PIN 12 an
|
||||||
|
// Damit wir es leichter haben, wenn sich das mal ändert speichern wir die 12 in einer
|
||||||
|
// sogenannten Konstante, die "PIEPSER" heißt.
|
||||||
|
// Das ist so wie bei LED_BUILTIN in der zweiten Übung
|
||||||
|
#define PIEPSER 12
|
||||||
|
|
||||||
|
void setup() {
|
||||||
|
pinMode(PIEPSER, OUTPUT);
|
||||||
|
}
|
||||||
|
|
||||||
|
void loop() {
|
||||||
|
// mit tone() lassen wir den Piepser Töne machen. Hier lassen wir ihn einen Ton mit einer Frequenz von 1KHz erzeugen
|
||||||
|
tone(PIEPSER, 1000);
|
||||||
|
delay(1000);
|
||||||
|
// und hiermit geht der Piepser wieder aus
|
||||||
|
noTone(PIEPSER);
|
||||||
|
delay(1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Kannst du auch eine Melodie mit dem Arduino erzeugen?
|
||||||
|
After Width: | Height: | Size: 180 KiB |
|
After Width: | Height: | Size: 359 KiB |
|
After Width: | Height: | Size: 60 KiB |
@@ -0,0 +1,88 @@
|
|||||||
|
TODO: Überarbeiten
|
||||||
|
|
||||||
|
# Z-Lab Arduino-Grundkurs Übung 4: Piepser
|
||||||
|
|
||||||
|
In dieser Übung erzeugen wir Töne mit einem Piepser.
|
||||||
|
|
||||||
|
Zuerst öffnen wir das Projekt über den gewohnten Weg. Der Name ist "04_Piepser"
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Verkabeln wir den Piepser mit dem Arduino mit dem Arduino
|
||||||
|
|
||||||
|
So muss da aussehen, wenn wir fertig sind:
|
||||||
|
|
||||||
|
<img src="Piepser.svg">
|
||||||
|
|
||||||
|
So und dann geht's wieder ans Programmieren.
|
||||||
|
|
||||||
|
In der Datei 04_Piepser.ino finden wir (ohne die ganzen Kommentare) folgenden Quellcode:
|
||||||
|
|
||||||
|
```c
|
||||||
|
#define PIEPSER 12
|
||||||
|
|
||||||
|
void setup() {
|
||||||
|
pinMode(PIEPSER, OUTPUT);
|
||||||
|
}
|
||||||
|
|
||||||
|
void loop() {
|
||||||
|
tone(PIEPSER, 1000);
|
||||||
|
delay(1000);
|
||||||
|
noTone(PIEPSER);
|
||||||
|
delay(1000);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Neu ist hier, dass wir schon vor der Setup-Funktion "etwas machen".
|
||||||
|
Dinge, die außerhalb der Funktionen gemacht werden stehen allen Funktionen zur Verfügung.
|
||||||
|
|
||||||
|
## define
|
||||||
|
|
||||||
|
```c
|
||||||
|
#define PIEPSER 12
|
||||||
|
```
|
||||||
|
|
||||||
|
Mit "#define" erstellen (definieren, wie define) wir eine sogenanntes Makro mit dem Namen "PIEPSER", das die 12 enthält.
|
||||||
|
Überall später im Quellcode wird "PIEPSER" mit 12 ersetzt.
|
||||||
|
Das macht es uns ein bisschen einfacher, denn:
|
||||||
|
* Wir müssen uns die 12 nicht merken, an der der Piepser hängt sondern können einfach immer "PIEPSER" schreiben, wenn wir mit dem Piepser etwas machen wollen
|
||||||
|
* Wir können den Anschluss, an dem der Piepser hängt ganz einfach ändern, in dem wir einfach nur die 12 durch etwas anderes ersetzen und müssen nicht im ganzen Code nach der 12 suchen
|
||||||
|
|
||||||
|
## tone() und noTone()
|
||||||
|
|
||||||
|
Wie der Name schon sagt ;)
|
||||||
|
Mit "tone()" erzeugen ir einen Ton.
|
||||||
|
Dabei ist der erste Parameter der Funktion der PIN (Anschluss), an dem der Piepser angeschlossen ist
|
||||||
|
der zweite Parameter ist die Frequenz, die der ton haben soll. In unserem Beispiel sin das 1000 Hz.
|
||||||
|
|
||||||
|
Und mit noTone() hört der Piepser wieder auf.
|
||||||
|
|
||||||
|
```c
|
||||||
|
tone(PIEPSER, 1000);
|
||||||
|
noTone(PIEPSER);
|
||||||
|
```
|
||||||
|
|
||||||
|
## Und wie könnte es weiter gehen?
|
||||||
|
* Kannst du auch eine Melodie abspielen?
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Hier klicken für Lösungsvorschläge - aber bitte erst selbst probieren! </summary>
|
||||||
|
|
||||||
|
```c
|
||||||
|
#define PIEPSER 12
|
||||||
|
|
||||||
|
void setup() {
|
||||||
|
pinMode(PIEPSER, OUTPUT);
|
||||||
|
}
|
||||||
|
|
||||||
|
void loop() {
|
||||||
|
tone(PIEPSER, 1000);
|
||||||
|
delay(1000);
|
||||||
|
tone(PIEPSER, 500);
|
||||||
|
delay(1000);
|
||||||
|
tone(PIEPSER, 1000);
|
||||||
|
delay(1000);
|
||||||
|
tone(PIEPSER, 500);
|
||||||
|
delay(1000);
|
||||||
|
```
|
||||||
|
</details>
|
||||||
|
After Width: | Height: | Size: 155 KiB |
|
After Width: | Height: | Size: 358 KiB |
@@ -0,0 +1,31 @@
|
|||||||
|
// Arduino Grundkurs des Z-Lab Bruchsal.
|
||||||
|
// Dies ist Übung 5: Ein Lichtsensor (analoger Sensor)
|
||||||
|
// Eine ausführliche Beschreibung mit Erklärungen findest du hier:
|
||||||
|
// https://git.digital-infinity.de/DigitalInfinity/Z-Lab/src/branch/main/Arduino_Grundlagen/05_Lichtsensor
|
||||||
|
// Dort findest du auch eine Skizze für die Verkabelung
|
||||||
|
|
||||||
|
// Hier legen wir fest, wo der Sensor angeschlossen werden soll, nämlich am Port A0
|
||||||
|
int sensorPin = A0;
|
||||||
|
// für die Anzeige verwenden wir wieder die LED auf dem Arduino
|
||||||
|
int ledPin = LED_BUILTIN;
|
||||||
|
// Und zum Speichern der Helligkeit brauchen wir eine Variable, die eine Zahl (int wie Integer, also eine Ganzzahl ohne Vorzeichen - wie eine natürliche Zahl) speichern kann
|
||||||
|
int sensorWert = 0;
|
||||||
|
|
||||||
|
void setup() {
|
||||||
|
pinMode(ledPin, OUTPUT);
|
||||||
|
}
|
||||||
|
|
||||||
|
void loop() {
|
||||||
|
// analogRead liest die aktuelle Helligkeit vom Lichtsensor
|
||||||
|
// Der Lichtsensor gibt eine Zahl zwischen 0 (für ganz dunkel) und 1000 (für ganz hell) zurück
|
||||||
|
sensorWert = analogRead(sensorPin);
|
||||||
|
// jetzt schalten iwr die LED ein
|
||||||
|
digitalWrite(ledPin, HIGH);
|
||||||
|
// Dann warten wir...
|
||||||
|
// Wir warten so lange, wie der Lichtsensor gesagt hat, dass es hell ist
|
||||||
|
// Also wenn es heller ist warten wir länger, weil die Zahl, die der Lichtsensor zurückgegeben hat größer ist
|
||||||
|
// Wenn es dunkler ist warten wir kürzer, weil die Zahl, die zurückgegeben wurde kleiner ist
|
||||||
|
delay(sensorWert);
|
||||||
|
digitalWrite(ledPin, LOW);
|
||||||
|
delay(sensorWert);
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 65 KiB |
@@ -0,0 +1,86 @@
|
|||||||
|
TODO: Überarbeiten
|
||||||
|
|
||||||
|
# Z-Lab Arduino-Grundkurs Übung 5: Lichtsensor (analoger Sensor)
|
||||||
|
|
||||||
|
In dieser Übung lesen wir einen Lichtsensor, einen sog. analogen Sensor aus.
|
||||||
|
|
||||||
|
Zuerst öffnen wir das Projekt über den gewohnten Weg. Der Name ist "05_Lichtsensor"
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Verkabeln wir den Piepser mit dem Arduino mit dem Arduino
|
||||||
|
|
||||||
|
So muss da aussehen, wenn wir fertig sind:
|
||||||
|
|
||||||
|
<img src="04_Lichtsensor.svg">
|
||||||
|
|
||||||
|
So und dann geht's wieder ans Programmieren.
|
||||||
|
|
||||||
|
In der Datei 05_Piepser.ino finden wir (ohne die ganzen Kommentare) folgenden Quellcode:
|
||||||
|
|
||||||
|
```c
|
||||||
|
int sensorPin = A0;
|
||||||
|
int ledPin = LED_BUILTIN;
|
||||||
|
int sensorWert = 0;
|
||||||
|
|
||||||
|
void setup() {
|
||||||
|
pinMode(ledPin, OUTPUT);
|
||||||
|
}
|
||||||
|
|
||||||
|
void loop() {
|
||||||
|
sensorWert = analogRead(sensorPin);
|
||||||
|
digitalWrite(ledPin, HIGH);
|
||||||
|
delay(sensorWert);
|
||||||
|
digitalWrite(ledPin, LOW);
|
||||||
|
delay(sensorWert);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Eigentlich gibt es hier gar nicht viel Neues.
|
||||||
|
Das Eine das in dieser Übung neu ist ist, dass wir die Ausgabe von einer Funktion als Eingabe für eine andere Funktion verwenden.
|
||||||
|
Das ist super praktisch, weil wir dann mit Werten, die z.B. von einem Sensor kommen, etwas machen können.
|
||||||
|
|
||||||
|
Das Andere ist, dass wir einen analogen Sensor auswählen.
|
||||||
|
Der Sensor gibt uns eine Zahl zwischen 0 und 1000 zurück, die wir in unserem Programm verwenden können.
|
||||||
|
|
||||||
|
## Zuweisen von Werten
|
||||||
|
|
||||||
|
```c
|
||||||
|
sensorWert = analogRead(sensorPin);
|
||||||
|
```
|
||||||
|
|
||||||
|
In dieser Zeile nehmen wir den Wert, den der Lichtsensor zurückgibt und "packen" oder "speichern" ihn in der Variable "sensorWert".
|
||||||
|
|
||||||
|
```c
|
||||||
|
delay(sensorWert);
|
||||||
|
```
|
||||||
|
|
||||||
|
Die Funktion delay() kennen wir schon aus den anderen Übungen. Bisher haben wir immer eine Zahl wie 100 oder 1000 angegeben, um zu bestimmen, wie lange das Programm verzögert werden soll.
|
||||||
|
Jetzt nehmen wir den Wert, den uns der Lichtsensor gegeben hat und sagen der delay()-Funktion, dass sie zwischen 0 und 1000 Milisekunden warten soll... Je nachdem, ob heller oder dunkler ist.
|
||||||
|
|
||||||
|
## 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>
|
||||||
|
|
||||||
|
```c
|
||||||
|
|
||||||
|
//TODO: Lösungsvorschlag anpassen
|
||||||
|
#define PIEPSER 12
|
||||||
|
|
||||||
|
void setup() {
|
||||||
|
pinMode(PIEPSER, OUTPUT);
|
||||||
|
}
|
||||||
|
|
||||||
|
void loop() {
|
||||||
|
tone(PIEPSER, 1000);
|
||||||
|
delay(1000);
|
||||||
|
tone(PIEPSER, 500);
|
||||||
|
delay(1000);
|
||||||
|
tone(PIEPSER, 1000);
|
||||||
|
delay(1000);
|
||||||
|
tone(PIEPSER, 500);
|
||||||
|
delay(1000);
|
||||||
|
```
|
||||||
|
</details>
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
*.aux
|
|
||||||
*.log
|
|
||||||
*.nav
|
|
||||||
*.out
|
|
||||||
*.snm
|
|
||||||
*.pdf
|
|
||||||
*.toc
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
\documentclass{beamer}
|
|
||||||
\usepackage[T1]{fontenc}
|
|
||||||
\usepackage[ngerman]{babel}
|
|
||||||
|
|
||||||
\usetheme{Boadilla}
|
|
||||||
|
|
||||||
\title{Arduino Grundlagen}
|
|
||||||
\subtitle{Wir bauen eine Ampel}
|
|
||||||
\author{Alexander Gabriel}
|
|
||||||
\institute{Z-Lab-Bruchsal}
|
|
||||||
\date{\today}
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\begin{frame}
|
|
||||||
\titlepage
|
|
||||||
\end{frame}
|
|
||||||
|
|
||||||
\section{01 Grundlagen}
|
|
||||||
\subsection{Folie 1}
|
|
||||||
|
|
||||||
\begin{frame}
|
|
||||||
\frametitle{01 Grundlagen - Folie 1}
|
|
||||||
Hier noch Text und Bilder zu den Grundlagen
|
|
||||||
\end{frame}
|
|
||||||
|
|
||||||
\begin{frame}
|
|
||||||
\frametitle{Outline}
|
|
||||||
\tableofcontents
|
|
||||||
\end{frame}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\end{document}
|
|
||||||
|
|
||||||