Dim in midroom
This commit is contained in:
@@ -49,8 +49,8 @@ void loop() {
|
||||
unsigned long t = millis();
|
||||
temp = myAHT10.readTemperature(AHT10_FORCE_READ_DATA);
|
||||
hum = myAHT10.readHumidity(AHT10_USE_READ_DATA);
|
||||
Serial.print(F("T: ")); Serial.print(temp);// Serial.println(F(" +-0.3C"));
|
||||
Serial.print(F("H: ")); Serial.print(hum);// Serial.println(F(" +-2%"));
|
||||
Serial.print(F("T: ")); Serial.println(temp);// Serial.println(F(" +-0.3C"));
|
||||
Serial.print(F("H: ")); Serial.println(hum);// Serial.println(F(" +-2%"));
|
||||
if (temp < 200){
|
||||
sendData(msgTemp, temp, 1);
|
||||
sendData(msgHum, hum, 1);
|
||||
@@ -59,8 +59,8 @@ void loop() {
|
||||
}
|
||||
sensorValue = analogRead(BATTERY_SENSE_PIN);
|
||||
v = sensorValue * 0.004659498;
|
||||
batteryPcnt = ((v-3.0) * 100) / 1.2;
|
||||
sendBatteryLevel(batteryPcnt);
|
||||
//batteryPcnt = ((v-3.0) * 100) / 1.2;
|
||||
//sendBatteryLevel(batteryPcnt);
|
||||
sendData(msgVolts, v, 2);
|
||||
//send(msgVolts.set(v, 2));
|
||||
Serial.println(F("Tm run")); Serial.println(millis() - t);
|
||||
@@ -84,7 +84,7 @@ void sendData(MyMessage msg, bool status)
|
||||
while(send_data == false){
|
||||
count++;
|
||||
send_data = send(msg.set(status));
|
||||
wait(1000, C_SET, V_STATUS);
|
||||
wait(100, C_SET, V_STATUS);
|
||||
if ((count == 3 )&&(send_data == 0)){ // Если сделано 3 попытки и нет подтверждения отправки
|
||||
count = 0; // Обнуляем счётчик
|
||||
send_data = 1; // Выходим из цикла
|
||||
@@ -98,7 +98,7 @@ void sendData(MyMessage msg, float status, uint8_t decm)
|
||||
while(send_data == false){
|
||||
count++;
|
||||
send_data = send(msg.set(status, decm));
|
||||
wait(1000, C_SET, V_STATUS);
|
||||
wait(100, C_SET, V_STATUS);
|
||||
if ((count == 3 )&&(send_data == 0)){ // Если сделано 3 попытки и нет подтверждения отправки
|
||||
count = 0; // Обнуляем счётчик
|
||||
send_data = 1; // Выходим из цикла
|
||||
@@ -112,7 +112,7 @@ void sendData(MyMessage msg, int status)
|
||||
while(send_data == false){
|
||||
count++;
|
||||
send_data = send(msg.set(status));
|
||||
wait(1000, C_SET, V_STATUS);
|
||||
wait(100, C_SET, V_STATUS);
|
||||
if ((count == 3 )&&(send_data == 0)){ // Если сделано 3 попытки и нет подтверждения отправки
|
||||
count = 0; // Обнуляем счётчик
|
||||
send_data = 1; // Выходим из цикла
|
||||
@@ -127,7 +127,7 @@ void sendData(MyMessage msg, uint32_t status)
|
||||
while(send_data == false){
|
||||
count++;
|
||||
send_data = send(msg.set(status));
|
||||
wait(1000, C_SET, V_STATUS);
|
||||
wait(100, C_SET, V_STATUS);
|
||||
if ((count == 3 )&&(send_data == 0)){ // Если сделано 3 попытки и нет подтверждения отправки
|
||||
count = 0; // Обнуляем счётчик
|
||||
send_data = 1; // Выходим из цикла
|
||||
|
||||
Reference in New Issue
Block a user