make the fake station working

This commit is contained in:
Flavien Haas 2018-05-14 00:47:13 +02:00
parent b441f80179
commit 498f558fd6
2 changed files with 5 additions and 2 deletions

View File

@ -1,3 +1,4 @@
#include <LoRa.h>
#define Serial SerialUSB
@ -46,7 +47,9 @@ void loop() {
hum = LireHumidite();
pluie = LirePluie();
delay(1000);
RadioEnvoyer(IDSTATION, IDMESSAGE, temp, hum, pluie);
LoRa.beginPacket();
LoRa.print("0107770002004000C8");
LoRa.endPacket();
delay(1000);
}
}

View File

@ -2,7 +2,7 @@
// DHT12 va de -25 à 75° avec resolution de 0,1°
// on renvoie la (Température+40)*10
uint16_t LireTemperature() {
float T = random(0,100);
float T = random(0,35);
return (uint16_t)((T + 40.0) * 10.0); // renvoie 150 -> -25°C et 1050 -> 75°C
}