make the fake station working
This commit is contained in:
parent
b441f80179
commit
498f558fd6
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
#include <LoRa.h>
|
#include <LoRa.h>
|
||||||
|
|
||||||
#define Serial SerialUSB
|
#define Serial SerialUSB
|
||||||
@ -46,7 +47,9 @@ void loop() {
|
|||||||
hum = LireHumidite();
|
hum = LireHumidite();
|
||||||
pluie = LirePluie();
|
pluie = LirePluie();
|
||||||
delay(1000);
|
delay(1000);
|
||||||
RadioEnvoyer(IDSTATION, IDMESSAGE, temp, hum, pluie);
|
LoRa.beginPacket();
|
||||||
|
LoRa.print("0107770002004000C8");
|
||||||
|
LoRa.endPacket();
|
||||||
delay(1000);
|
delay(1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
// DHT12 va de -25 à 75° avec resolution de 0,1°
|
// DHT12 va de -25 à 75° avec resolution de 0,1°
|
||||||
// on renvoie la (Température+40)*10
|
// on renvoie la (Température+40)*10
|
||||||
uint16_t LireTemperature() {
|
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
|
return (uint16_t)((T + 40.0) * 10.0); // renvoie 150 -> -25°C et 1050 -> 75°C
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user