Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Valores de temp x 10
- int tempMin = 359;
- int tempMax = 369;
- int tempInicial = 365;
- // Valores de bpm
- int bpmMin = 40;
- int bpmMax = 100;
- int bpmInicial = 60;
- float temp = tempInicial/10.0;
- int bpm = bpmInicial;
- void setup() {
- Serial.begin(9600);
- }
- void loop() {
- temp = temp + random(-1, 2) / 10.0;
- if (temp * 10 > tempMax)
- temp = tempMax/10.0;
- if (temp * 10 < tempMin)
- temp = tempMin/10.0;
- bpm = bpm + random(-1, 2);
- if (bpm > bpmMax)
- bpm = bpmMax;
- if (bpm < bpmMin)
- bpm = bpmMin;
- Serial.print(temp);
- Serial.print(" ");
- Serial.println(bpm);
- delay(5000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement