User manual

Ausgabe 19.05.2017 Copyright by Joy-IT 26
void YELLOW_YES() // executes the code until the yellow LED
// is on. Ends the circle when the reset
// button is pressed.
{
while(digitalRead(restpin)==1)
{
digitalWrite(redled,LOW);
digitalWrite(greenled,LOW);
digitalWrite(yellowled,HIGH);
}
clear_led();
}
void GREEN_YES() // executes the code until the green LED
// is on. Ends the circle when the reset
// button is pressed.
{
while(digitalRead(restpin)==1)
{
digitalWrite(redled,LOW);
digitalWrite(greenled,HIGH);
digitalWrite(yellowled,LOW);
}
clear_led();
}
void clear_led() // turns all LEDs off
{
digitalWrite(redled,LOW);
digitalWrite(greenled,LOW);
digitalWrite(yellowled,LOW);
}
Achten Sie bie darauf, dass Sie beide Code-Teile in ihrem Sketch des Arduino-Programms
zusammenfügen.
Wenn eine Taste betägt wird, schaltet sich die entsprechende LED ein.
Wird die Reset-Taste betägt, schaltet sich die entsprechende LED wieder aus.