Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Controllers
  3. Vera
  4. Decimals not appear at Vera UI

Decimals not appear at Vera UI

Scheduled Pinned Locked Moved Vera
5 Posts 3 Posters 2.0k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • rabeliyoR Offline
    rabeliyoR Offline
    rabeliyo
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • H Offline
      H Offline
      hek
      Admin
      wrote on last edited by
      #2

      @rabeliyo said:
      VoltLevelBat must be a float (or casted to a float) when calling set.

      1 Reply Last reply
      0
      • rabeliyoR Offline
        rabeliyoR Offline
        rabeliyo
        wrote on last edited by
        #3

        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;

        B 1 Reply Last reply
        0
        • rabeliyoR rabeliyo

          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;

          B Offline
          B Offline
          BulldogLowell
          Contest Winner
          wrote on last edited by
          #4

          @rabeliyo

          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.

          1 Reply Last reply
          0
          • rabeliyoR Offline
            rabeliyoR Offline
            rabeliyo
            wrote on last edited by rabeliyo
            #5

            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

            0_1459000846524_Sin título.jpg

            Vera Files:
            http://www51.zippyshare.com/v/fk2Ay5ww/file.html

            Now i have a problem with the 3.3 PIR mod, i open a new post XD

            1 Reply Last reply
            0

            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
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            15

            Online

            12.0k

            Users

            11.2k

            Topics

            113.4k

            Posts


            Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • MySensors
            • OpenHardware.io
            • Categories
            • Recent
            • Tags
            • Popular