Instructions
25/06/2015 DFRduinoBeginnerKitForArduinoV3SKU:DFR0100RobotWiki
http://www.dfrobot.com/wiki/index.php/DFRduino_Beginner_Kit_For_Arduino_V3_SKU:DFR0100 4/23
36
37
38
39
40
delay(100);
}
delay(5000);
}
3.TrafficLight
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/*
TrafficLight
ThiscodecopiedfromthebookBeginning‐Arduino.
*/
intcarRed=12;//assignthecarlights
intcarYellow=11;
intcarGreen=10;
intbutton=9;//buttonpin
intpedRed=8;//assignthepedestrianlights
intpedGreen=7;
intcrossTime=5000;//timeforpedestriantocross
unsignedlongchangeTime;//timesincebuttonpressed
voidsetup(){
pinMode(carRed,OUTPUT);