Stap 3: Arduino programmering
#include
int blauw = 9;
int rood = 10;
int yell = 11;
int groen = 12;
int bblue = 3;
int gefokt = 4;
int byell = 5;
int bgreen = 6;
VOID Setup
{
pinMode (blauw, uitvoer);
pinMode (rood, OUTPUT);
pinMode (schreeuw, uitvoer);
pinMode (groen, uitvoer);
pinMode (bblue, INPUT);
pinMode (gefokt, INPUT);
pinMode (byell, INPUT);
pinMode (bgreen, INPUT);
}
void loop
{
if(digitalRead(Bblue) == laag)
{
digitalWrite(blue,HIGH);
delay(50);}
anders
{
digitalWrite(blue,LOW);
delay(5 0);
}
if(digitalRead(Bred) == laag)
{
digitalWrite(red,HIGH);
delay(50);
}
anders
{
digitalWrite(red,LOW);
delay(50);
}
if(digitalRead(byell) == laag)
{
digitalWrite(yell,HIGH);
delay(50);
}
anders
{
digitalWrite(yell,LOW);
delay(50);
}
if(digitalRead(bgreen) == laag)
{
digitalWrite(green,HIGH);
delay(50);
}
anders
{
digitalWrite (groen, lage);
delay(50);
}
}