MÓDULO DE SEMÁFORO LED 10MM 5V PARA ARDUINO Y RASPBERRY
search
  • MÓDULO DE SEMÁFORO LED 10MM 5V PARA ARDUINO Y RASPBERRY
  • MÓDULO DE SEMÁFORO LED 10MM 5V PARA ARDUINO Y RASPBERRY

MÓDULO DE SEMÁFORO LED 10MM 5V PARA ARDUINO Y RASPBERRY (4 und.)

0,95 €
Quantidade
Entrega imediata

 

Política de segurança

 

Política de entrega

Introdução

Quando você aprende o microcontrolador, geralmente pode usar três LEDs, vermelho, verde e amarelo, para simular o piscar do semáforo por meio de uma conexão externa. Por isso, projetamos especialmente este módulo, que é muito conveniente para a fiação, e no módulo você pode ver o LED vermelho, amarelo e verde. Este módulo é totalmente compatível com o microcontrolador Arduino e o sistema raspberry pi.





Especificação

Tensão de trabalho: 5VDC

Tipo de interface: 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
Novo