hardmood.info

A bilingual DokuWiki to share information on Prof Felix Beck's courses and academic involvement.

User Tools

Site Tools


22_11_21

This is an old revision of the document!


GL 2

Grundlagen der Gestaltung 2

Julia Wand (Tutorin)
Montag, 22. November 2021


Arduino-Workshop

Im Rahmen des Tutor*innen-Workshops bekommen die Studierenden einen Einblick in das Arduino-Board und die Software. Dabei werden in drei kleinen Teilaufgaben zunächst eine LED und am Ende mehrere LEDs zum Blinken gebracht. Die Studierenden sollen in den Übungen vor allem eigenständig experimentieren.

Für eine LED wird das Blink-Beispiel verwendet. Der Code dafür sieht wie folgt aus:

void setup:

pinMode(LED_BUILTIN, OUTPUT);

void loop:

digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
delay(1000);                       // wait for a second
digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
delay(1000);                       // wait for a second

Für zwei LEDs wird dieser Code verwendet:

void setup:

pinMode(13,OUTPUT); pinMode(12,OUTPUT);

void loop:

digitalWrite(13,HIGH);
digitalWrite(12,LOW);
delay(1000);
digitalWrite(12,HIGH);
digitalWrite(13,LOW);
delay(1000);

Dieser Code kann an eine beliebige Anzahl von LEDs angepasst werden.

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
/var/www/vhosts/hardmood.info/httpdocs/data/attic/22_11_21.1637944418.txt.gz · Last modified: 2023/10/17 13:05 (external edit)