Created
March 15, 2016 14:16
-
-
Save lorenrogers/215258b0573e3e2d46c9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| long randomvalue = 0; | |
| long countervalue = 0; | |
| int serialvalue; | |
| int started = 0; | |
| void setup() | |
| { | |
| Serial.begin(9600); | |
| } | |
| void loop() | |
| { | |
| if(Serial.available()){ | |
| serialvalue = Serial.read(); | |
| started = 1; | |
| } | |
| if (started) { | |
| randomvalue = random(1000); | |
| Serial.print(countervalue); | |
| Serial.print(" "); | |
| Serial.print(randomvalue); | |
| Serial.print(" "); | |
| Serial.print(serialvalue); | |
| Serial.println(); | |
| countervalue = (countervalue +1) % 1000; | |
| delay(100); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment