Created
September 19, 2021 14:02
-
-
Save rafitc/7e40ee99dc2b30a4bbff78a5ae95991d 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
| int hum = 40; | |
| int temp = 30; | |
| int setValue = 0; | |
| int c = 0; | |
| bool gotValue = false; | |
| void setup() { | |
| Serial.begin(9600); | |
| Serial.println("waiting to get value : "); | |
| while(!gotValue){ | |
| if ( Serial.available() ){ | |
| setValue = Serial.parseInt(); | |
| gotValue = true; | |
| Serial.print("GOT set value : "); | |
| Serial.println(setValue); | |
| } | |
| } | |
| } | |
| void loop() { | |
| hum = random(10,90); | |
| Serial.print(hum); | |
| Serial.print(" "); | |
| temp = hum = random(30,70); | |
| Serial.println(temp); | |
| delay(500); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment