Skip to content

Instantly share code, notes, and snippets.

@rafitc
Created September 19, 2021 14:02
Show Gist options
  • Select an option

  • Save rafitc/7e40ee99dc2b30a4bbff78a5ae95991d to your computer and use it in GitHub Desktop.

Select an option

Save rafitc/7e40ee99dc2b30a4bbff78a5ae95991d to your computer and use it in GitHub Desktop.
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