0% found this document useful (0 votes)
5 views1 page

Código Arduino

The document contains C++ code for controlling three LEDs connected to pins 8, 9, and 10. In the first loop, each LED is turned on sequentially with a one-second delay, while in the second loop, all LEDs are turned on together for one second and then turned off. The setup function initializes the pins as outputs.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Código Arduino

The document contains C++ code for controlling three LEDs connected to pins 8, 9, and 10. In the first loop, each LED is turned on sequentially with a one-second delay, while in the second loop, all LEDs are turned on together for one second and then turned off. The setup function initializes the pins as outputs.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

// C++ code

//
int vermelho = 10;
int amarelo = 9;
int verde = 8;
void setup()
{
pinMode(vermelho, OUTPUT);
pinMode(amarelo, OUTPUT);
pinMode(verde, OUTPUT);
}

void loop()
{
digitalWrite(verde, HIGH);
delay(1000);
digitalWrite(verde, LOW);

digitalWrite(amarelo, HIGH);
delay(1000);
digitalWrite(amarelo, LOW);

digitalWrite(vermelho, HIGH);
delay(1000);
digitalWrite(vermelho, LOW);
}

// C++ code
//
int vermelho = 10;
int amarelo = 9;
int verde = 8;
void setup()
{
pinMode(vermelho, OUTPUT);
pinMode(amarelo, OUTPUT);
pinMode(verde, OUTPUT);
}

void loop()
{
digitalWrite(verde, HIGH);
digitalWrite(amarelo, HIGH);
digitalWrite(vermelho, HIGH);
delay(1000);

digitalWrite(verde, LOW);
digitalWrite(amarelo, LOW);
digitalWrite(vermelho, LOW);
delay(1000);

You might also like