arduino-course/Week 2/RGB/RGB.ino

20 lines
313 B
Arduino
Raw Normal View History

2019-11-15 23:54:58 +01:00
// RGB LED
int red = 3;
int blue = 5;
int green = 6;
void setup() {
pinMode(red, OUTPUT);
pinMode(blue, OUTPUT);
pinMode(green, OUTPUT);
}
void loop() {
analogWrite(red, random(0,255));
delay(200);
analogWrite(blue, random(0,255));
delay(200);
analogWrite(green, random(0,255));
delay(200);
}