Traffic Light - DFRobot DFR0100 Manual

Beginner kit for arduino v3
Table of Contents

Advertisement

25/06/2015
36
        delay(100);                          
37
        }
38
 
39
        delay(5000);
40
}
3.Traffic Light
?
1
/*
2
   Traffic Light
3
   This code copied from the book Beginning‐Arduino.
4
*/
5
 
int
carRed = 12; //assign the car lights
6
 
int
carYellow = 11;
7
 
int
carGreen = 10;
8
 
int
button = 9; //button pin
9
 
int
pedRed = 8; //assign the pedestrian lights
10
 
int
pedGreen = 7;
11
 
int
crossTime =5000; //time for pedestrian to cross
12
 
unsigned long
changeTime;//time since button pressed
13
 
14
 
void
setup() {
15
    pinMode(carRed, OUTPUT);
http://www.dfrobot.com/wiki/index.php/DFRduino_Beginner_Kit_For_Arduino_V3_SKU:DFR0100
DFRduino Beginner Kit For Arduino V3 SKU:DFR0100 ­ Robot Wiki
4/23

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DFR0100 and is the answer not in the manual?

Questions and answers

Table of Contents