Created
February 22, 2019 21:14
-
-
Save davidleandro/b9a8332c85d5990ad04b482e3308bdef to your computer and use it in GitHub Desktop.
LED RGB Arduino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const int pin_verm = 10; | |
const int pin_verd = 9; | |
const int pin_azul = 8; | |
void setup() { } | |
void loop() { | |
analogWrite(pin_azul, 0); | |
for (int verm=0; verm <= 255; verm++){ | |
analogWrite(pin_verm, verm); | |
delay(10); | |
} | |
analogWrite(pin_verm, 0); | |
for (int verd=0; verd <= 255; verd++){ | |
analogWrite(pin_verd, verd); | |
delay(10); | |
} | |
analogWrite(pin_verd, 0); | |
for (int azul=0; azul <= 255; azul++){ | |
analogWrite(pin_azul, azul); | |
delay(10); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment