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 1.6k 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
    • hekH Offline
      hekH 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;

        BulldogLowellB 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;

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


            11

            Online

            11.7k

            Users

            11.2k

            Topics

            113.1k

            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