Created
April 29, 2011 16:11
-
-
Save cswingler/948545 to your computer and use it in GitHub Desktop.
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
/* | |
Random Blink | |
This just randomly picks a value and analogWrite()s it to the LED | |
pin. | |
*/ | |
/* | |
int ledPin = 9; | |
int RAND_MAX = 100; | |
*/ | |
void setup() { | |
// we do nothing! | |
} | |
void loop() { | |
// Randomly set the pin to the value | |
// crap I don't remember how to generate random numbers in C++ :( | |
int rand_val = rand() % 100; | |
analogWrite(9, rand_val); | |
// Wait 30 microseconds to see it | |
delay (30); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment