2.- Arduino with the HC-05 Bluetooth module sends two random numbers to the app.
p9A0i_bluetooth_aleatorios_V2.aia (3.3 KB)
- Arduino + Module HC-05.
- Sketch.
const unsigned long interval= 3000;
unsigned long previousMillis;
unsigned long currentMillis;
String send_this;
void setup() {
Serial.begin(9600);
}
void loop() {
currentMillis = millis();
if (currentMillis - previousMillis >= interval){
float t = random(0,10000) / 100.0;
float h = random(0,10000) / 100.0;
send_this = String(t,2) + "," + String(h,2);
Serial.println(send_this);
previousMillis = millis();
}
}
- App Inventor. Blocks.
- Screenshot.
- This guide in Spanish:
Bluetooth HC-05. Cambiar baudios. App Inventor.


