Re: Problem with huge value for "usage"
Posted: Tuesday 29 March 2016 19:19
.... update to the latest mysensors version ?
https://github.com/mysensors/Arduino/bl ... yMessage.h
https://github.com/mysensors/Arduino/bl ... yMessage.h
Open source Home Automation System
https://forum.domoticz.com/
Code: Select all
#define ID_S_GAS 34
[...]
#ifdef ID_S_GAS
MyMessage msg_S_GAS_F(ID_S_GAS, V_FLOW);
MyMessage msg_S_GAS_V(ID_S_GAS, V_VOLUME);
#endif
[...]
#ifdef ID_S_GAS
Serial.println(" S_GAS");
present(ID_S_GAS, S_GAS, "Gas Level");
wait(SHORT_WAIT);
#endif
[...]
#ifdef ID_S_GAS
gas();
#endif
[...]
#ifdef ID_S_GAS
void gas() {
Serial.print("Gas flow is: " );
Serial.println(map(randNumber, 1, 100, 0, 150));
send(msg_S_GAS_F.set(map(randNumber, 1, 100, 0, 150)));
Serial.print("Gas volume is: " );
Serial.println(map(randNumber, 1, 100, 0, 150));
send(msg_S_GAS_V.set(map(randNumber, 1, 100, 0, 150)));
}
#endif