Created
October 31, 2017 20:13
-
-
Save omiq/199b49773ae084c81e07d18a66d72c94 to your computer and use it in GitHub Desktop.
Random lights
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
void setup() { | |
// put your setup code here, to run once: | |
pinMode(A0,OUTPUT); | |
pinMode(A1,OUTPUT); | |
randomSeed(42); | |
} | |
void loop() { | |
// put your main code here, to run repeatedly: | |
int bright; | |
// set the brightness to a random num | |
bright = random(0,255); | |
// turn on LEDs | |
analogWrite(A0,bright); | |
analogWrite(A1,bright); | |
delay(100); | |
// turn off LEDs | |
analogWrite(A0,50); | |
analogWrite(A1,50); | |
delay(100); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment