Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
int LEDRpin = 3;
int LEDGpin = 5;
int LEDBpin = 6;
void turn(int r, int g, int b) {
analogWrite(LEDRpin, r);
analogWrite(LEDGpin, g);
analogWrite(LEDBpin, b);
}
void setup() {
pinMode(LEDRpin, OUTPUT);
pinMode(LEDGpin, OUTPUT);
pinMode(LEDBpin, OUTPUT);
turn(0, 0, 0);
}
void loop() {
turn(random(256), random(256), random(256));
delay(100);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.