hardmood.info

A DokuWiki flirting with bilingualism to chronicle Prof. Felix Beck's courses and academic antics.

User Tools

Site Tools


22_11_21

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
22_11_21 [2021/11/25 13:22] – [Arduino-Workshop] julia22_11_21 [2021/11/26 16:34] – [Arduino-Workshop] julia
Line 12: Line 12:
  
 {{:arduino6.jpg?400|}} {{:arduino2.jpg?400|}} {{:arduino6.jpg?400|}} {{:arduino2.jpg?400|}}
 +
 +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
 +
 +{{:arduino11.jpg?400|}} {{:arduino12.jpg?400|}}
 +
 +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.
 +
 +{{:arduino18.jpg?400|}} {{:arduino20.jpg?400|}}
 +
 +