arduino:start
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
arduino:start [2014/11/15 08:53] – ros | arduino:start [2014/12/03 07:48] (aktuell) – gelöscht ros | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
- | ====== Digitalelektronik mit Arduino ====== | ||
- | Workshop an der Fachschaftstagung 2014 | ||
- | |||
- | ===== Links ===== | ||
- | |||
- | ==== Arduino ==== | ||
- | |||
- | * [[http:// | ||
- | * [[http:// | ||
- | |||
- | ==== Entwicklungsumgebungen (IDEs) ==== | ||
- | |||
- | * [[http:// | ||
- | * [[http:// | ||
- | * [[http:// | ||
- | * [[http:// | ||
- | | ||
- | ==== Shops ==== | ||
- | |||
- | * [[http:// | ||
- | * [[https:// | ||
- | * [[http:// | ||
- | |||
- | < | ||
- | const int DATA_PIN = 0; | ||
- | const int SHIFT_CLOCK_PIN = 1; | ||
- | const int STORAGE_CLOCK_PIN = 2; | ||
- | |||
- | const int MUSTER[] = { | ||
- | B01111110, | ||
- | B10000001, | ||
- | B10101001, | ||
- | B10000001, | ||
- | B10000101, | ||
- | B10111001, | ||
- | B10000001, | ||
- | B01111110 | ||
- | }; | ||
- | |||
- | const int DELAY[] = {200, 100, 20, 10, 2, 1}; | ||
- | int DELAY_SIZE = sizeof(DELAY) / sizeof(int); | ||
- | |||
- | int row = 0; | ||
- | int delayIndex = 0; | ||
- | int changeTime; | ||
- | |||
- | void setMatrix(byte row, byte col) { | ||
- | digitalWrite(STORAGE_CLOCK_PIN, | ||
- | shiftOut(DATA_PIN, | ||
- | shiftOut(DATA_PIN, | ||
- | digitalWrite(STORAGE_CLOCK_PIN, | ||
- | } | ||
- | |||
- | void setup() { | ||
- | pinMode(DATA_PIN, | ||
- | pinMode(SHIFT_CLOCK_PIN, | ||
- | pinMode(STORAGE_CLOCK_PIN, | ||
- | changeTime = millis() + 5000; | ||
- | } | ||
- | |||
- | void loop() { | ||
- | setMatrix(row, | ||
- | row = (row + 1) % 8; | ||
- | delay(DELAY[delayIndex]); | ||
- | |||
- | if (millis() >= changeTime && delayIndex < DELAY_SIZE-1) { | ||
- | delayIndex = delayIndex + 1; | ||
- | changeTime = millis() + 5000; | ||
- | } | ||
- | } | ||
- | </ |
arduino/start.1416037990.txt.gz · Zuletzt geändert: 2020/10/13 14:25 (Externe Bearbeitung)