8.- App receives data from Arduino. Clock.Interval. Arduino delay. Buffer.
p9A0i_bluetooth_aleatorio.aia (2.9 KB)
a)
Clock.Interval = 300
Arduino delay = 200
-
App cannot process the information because the Clock "is slower" than the Arduino.
The buffer is being filled, values that arrive and have not yet been processed. -
When the Buffer reaches a certain value, for example 120, you remove power to the Arduino. What happens with buffer?
b) Change Clock.Interval
Clock.Interval = 100
Arduino delay = 200
- Now the Clock "is faster" than the Arduino.
Buffer = 0
Therefore, Clock.Interval < delay Arduino
// Juan A. Villalpando
// http://kio4.com/appinventor/9A0_Resumen_Bluetooth.htm
int aleatorio;
void setup() {
Serial.begin(9600);
}
void loop() {
aleatorio = random(0,100);
Serial.println(aleatorio);
delay(200); // Clock.Interval < delay Arduino
}