Changeset 1151 in t29-www for physical-computing
- Timestamp:
- Feb 28, 2017, 9:38:38 PM (7 years ago)
- Location:
- physical-computing
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
physical-computing/TM1638_Lauftext/TM1638_Lauftext.ino
r1144 r1151 1 1 2 // Sketch "laufender Text" auf TM1638 (LED & Key)2 // Mit diesem Sketch kannst du auf dem Modul LED & KEY einen Lauftext darstellen 3 3 4 4 #include <TM1638.h> 5 5 6 TM1638 aktuellesModule(8, 9, 7); 7 8 const char nachricht[] = " AES SUPER AG "; 9 int base = 0; 6 TM1638 Module(8, 9, 7); //(DIO, CLK, STB) 10 7 11 8 void setup() { 12 9 } 13 10 11 const char nachricht[] = " AES SUPER AG "; //8 Blank´s vor und hinter dem Text 12 int startIndex = 0; 13 14 14 void loop() 15 15 { 16 //bestimme Ausschnitt der Nachricht zum Anzeigen passend zum module. 17 const char* pos = nachricht + base; 16 //bestimme Ausschnitt der Nachricht zum Anzeigen passend zum Module. 17 18 Module.setDisplayToString(&nachricht[startIndex]); 18 19 19 if ( (pos >= nachricht) && ((pos + 8) < (nachricht + sizeof(nachricht)))) { 20 aktuellesModule.setDisplayToString(pos); 21 } else { 22 aktuellesModule.clearDisplay(); 23 } 20 startIndex++; 24 21 25 base++;26 27 //Wenn das Ende der Nachricht erreicht ist, wieder von vorne anfangen.28 if (base == sizeof(nachricht) - 8){29 base = -8;22 // Nachricht am Ende angekommen: Wieder von vorne anfangen. 23 24 if (startIndex >= (sizeof(nachricht) - 8)) 25 { 26 startIndex = 0; 30 27 } 31 28 … … 33 30 } 34 31 35 /* Kurzinfo: "sizeof" kann den Speicherbedarf von Variablen bzw.Datentypen ermitteln36 * "char" hat ähnliche Bedeutung wie int, byte usw. Um z.B. Buchstaben zu speichern37 * benötigt man den Variablentyp char.38 */ -
physical-computing/index.php
r1150 r1151 103 103 104 104 <?php $zaun_aes->printAnchor(); ?> 105 Speziell für Schüler der AES: <?php $zaun_aes->printMiniForm(); ?> <small>(Zuletzt aktualisiert am 2 3.2.2017)</small><br><br>105 Speziell für Schüler der AES: <?php $zaun_aes->printMiniForm(); ?> <small>(Zuletzt aktualisiert am 28.2.2017)</small><br><br> 106 106 107 107 <?php $zaun_aes->start(); ?> 108 ....für Victor: Am Montag (27.2.) findet die AG nicht statt.....<br><br>109 108 110 109 <a href="/physical-computing/ph6.pdf"> Physical-Computing Blatt 6 (PDF)</a> <small>Update Version 1.5</small><br> 111 <a href="/physical-computing/ph7.pdf"> Physical-Computing Blatt 7 (PDF)</a> < br>110 <a href="/physical-computing/ph7.pdf"> Physical-Computing Blatt 7 (PDF)</a> <small>Update Version 1.1</small><br> 112 111 <br> 113 112 Hier noch die Sketches zur Anwendung des Moduls: LED & KEY <br>
Note: See TracChangeset
for help on using the changeset viewer.