LED traffic light module 10MM 5V FOR ARDUINO Y RASPBERRY
search
  • LED traffic light module 10MM 5V FOR ARDUINO Y RASPBERRY
  • LED traffic light module 10MM 5V FOR ARDUINO Y RASPBERRY

LED traffic light module 10MM 5V FOR ARDUINO Y RASPBERRY (4 und.)

€0.95
Quantity
immediate delivery

 

Security policy

 

Delivery policy

Introduction

When you learn the microcontroller, you can usually use three LEDs, namely red, green, and yellow, to simulate flashing the traffic light through an external connection. So we specially designed this module which is very convenient for wiring, and on the module you can see the red, yellow and green LED. This module is fully compatible with the Arduino microcontroller and the raspberry pi system.





Specification

Working voltage: 5VDC

Interface type: digital

SAMPLE CODE
int redled =5; // initialize digital pin 5.
int yellowled =4; // initialize digital pin 4.
int greenled =3; // initialize digital pin 3.
void setup()
{
pinMode(redled, OUTPUT);// set the pin with red LED as “output”
pinMode(yellowled, OUTPUT); // set the pin with yellow LED as “output”
pinMode(greenled, OUTPUT); // set the pin with green LED as “output”
}
void loop()
{
digitalWrite(greenled, HIGH);//// turn on green LED
delay(5000);// wait 5 seconds
digitalWrite(greenled, LOW); // turn off green LED
for(int i=0;i {
delay(500);// wait 0.5 seconds
digitalWrite(yellowled, HIGH);// turn on yellow LED
delay(500);// wait 0.5 seconds
digitalWrite(yellowled, LOW);// turn off yellow LED
}
delay(500);// wait 0.5 seconds
digitalWrite(redled, HIGH);// turn on red LED
delay(5000);// wait 5 seconds
digitalWrite(redled, LOW);// turn off red LED
}

703663
New