Categorías

Ref. 108.KS0310

MODULO EXPERIMENTO SEMAFORO DE TRAFICO

Stock: 40  
Ref. 108.KS0310
Precio (IVA incluido) 3,509 €
Introducción

Cuando aprenda el microcontrolador, normalmente puede usar tres LED, a saber, rojo, verde y amarillo para simular el parpadeo del semáforo a través de una conexión externa. Así que diseñamos especialmente este módulo que es muy conveniente para el cableado, y en el módulo puede ver el LED rojo, amarillo y verde. Este módulo es totalmente compatible con el microcontrolador Arduino y el sistema raspberry pi.





Especificación

Voltaje de trabajo: 3.3-5v

Tipo de interfaz: 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
}
  • Periféricos de Cabo Vilán S.L. - C.I.F.: ESB70364260
  • Sofía Rivas, 1 - 15123 - Camariñas - A Coruña - España.