Decimals not appear at Vera UI
-
Hello , I am modifying files multimeter to work well in UI7 , so far work well , but can not get me decimals appear in the interface vera ( in arduino if displayed) , only the first number , for example appears .
Sketch
gw.send ( msgVoltBat.set ( ( int ) VoltLevelBat , 2) , 1) ;
sends 3.95 volts and appears vera UI 3.00
I tried to change the type of variavle in S_Multimeter1 to i4 , UI4 , string , float without results.
Use this skit to control the voltage of the battery and solar module and need to be accurate.
Thank you very much
-
ok!! Like this?
float VoltBatScale = analogRead(A2);
float VoltLevelBat = VoltBatScale*4.12/376; //376 is the analog read at 4.12v (full charged battery)
if (VoltLevelBat != lastVoltLevelBat) {
gw.send(msgVoltBat.set((float)VoltLevelBat,2),1);
lastVoltLevelBat = VoltLevelBat; -
ok!! Like this?
float VoltBatScale = analogRead(A2);
float VoltLevelBat = VoltBatScale*4.12/376; //376 is the analog read at 4.12v (full charged battery)
if (VoltLevelBat != lastVoltLevelBat) {
gw.send(msgVoltBat.set((float)VoltLevelBat,2),1);
lastVoltLevelBat = VoltLevelBat;yes, but you shouldn't need to cast a float to a float like you are doing here:
gw.send(msgVoltBat.set((float)VoltLevelBat,2),1);also, because of the way floating point numbers work:
if (VoltLevelBat != lastVoltLevelBat) {may be a LOT more frequently than you may actually wish. Consider just updating the controller with a simple timer instead.
-
Works!!! Thanks a lot, i upload my remake of multimeter for UI7, all works but i only use the current and the voltage for my solar module, i will change the impedance to Kw/h

Vera Files:
http://www51.zippyshare.com/v/fk2Ay5ww/file.htmlNow i have a problem with the 3.3 PIR mod, i open a new post XD
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login