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. My Project
  3. Sensebender Micro + button

Sensebender Micro + button

Scheduled Pinned Locked Moved My Project
sensebendersensebender micbutton
27 Posts 5 Posters 10.5k Views 8 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.
  • Pierre PP Pierre P

    If I undefine: //#define BATT_SENSOR 199
    it's working.
    But your code still not 100% so we have to find why.
    But... but, i think i'm making a mistake: yes i plan to use 3volts power. But, i don't want it as a sensor ! I wan't it as a battery level like the very first SensebenderMicro sketch. So... I have to undefine BATT_SENSOR ? And i will not have it set to 3Vcc=100% ?
    0_1453547060579_jeedom-004.png

    iotcrazyI Offline
    iotcrazyI Offline
    iotcrazy
    wrote on last edited by
    #21

    @Pierre-P you controller image looks great . What controller is it ?

    Pierre PP 1 Reply Last reply
    0
    • iotcrazyI iotcrazy

      @Pierre-P you controller image looks great . What controller is it ?

      Pierre PP Offline
      Pierre PP Offline
      Pierre P
      wrote on last edited by
      #22

      @iotcrazy It is Jeedom, you can find some information here: http://www.mysensors.org/controller/jeedom
      It use an RPI2 if you ant to make it yourself, and a major version will come during the week !

      No quote, no forum notification (else, the mail box ring every minutes !). Thanks, and have a very good MySensors day !

      1 Reply Last reply
      0
      • alexsh1A Offline
        alexsh1A Offline
        alexsh1
        wrote on last edited by
        #23

        @martinhjelmare Any idea why siVolt is reporting values rounding up to either 2V or 3V in Domoticz? All I'd like to have is something like 2.9V

        martinhjelmareM 1 Reply Last reply
        0
        • alexsh1A alexsh1

          @martinhjelmare Any idea why siVolt is reporting values rounding up to either 2V or 3V in Domoticz? All I'd like to have is something like 2.9V

          martinhjelmareM Offline
          martinhjelmareM Offline
          martinhjelmare
          Plugin Developer
          wrote on last edited by martinhjelmare
          #24

          @alexsh1

          How are you calculating and sending it? Did you change to float? There was a bug in my original sketch.

          Make sure at least one of the operands is a float in the division.

          float siVolt = vcc / 1000.0;
          
          alexsh1A 1 Reply Last reply
          0
          • martinhjelmareM martinhjelmare

            @alexsh1

            How are you calculating and sending it? Did you change to float? There was a bug in my original sketch.

            Make sure at least one of the operands is a float in the division.

            float siVolt = vcc / 1000.0;
            
            alexsh1A Offline
            alexsh1A Offline
            alexsh1
            wrote on last edited by
            #25

            @martinhjelmare

            Yes, it is declared as float

            void sendBattLevel(bool force)
            {
              if (force) lastBattery = -1;
              long vcc = readVcc();
              if (vcc != lastBattery) {
                lastBattery = vcc;
              float siVolt = vcc / 1000;
            #ifdef BATT_SENSOR
                gw.send(msgBatt.set(siVolt, 2));
            #endif
            

            It is reported as either 2.000V (battery) or 3.000V (USB) in Domoticz
            Changing siVolt to int or changing 2 in set does not change anything.

            martinhjelmareM 1 Reply Last reply
            0
            • alexsh1A alexsh1

              @martinhjelmare

              Yes, it is declared as float

              void sendBattLevel(bool force)
              {
                if (force) lastBattery = -1;
                long vcc = readVcc();
                if (vcc != lastBattery) {
                  lastBattery = vcc;
                float siVolt = vcc / 1000;
              #ifdef BATT_SENSOR
                  gw.send(msgBatt.set(siVolt, 2));
              #endif
              

              It is reported as either 2.000V (battery) or 3.000V (USB) in Domoticz
              Changing siVolt to int or changing 2 in set does not change anything.

              martinhjelmareM Offline
              martinhjelmareM Offline
              martinhjelmare
              Plugin Developer
              wrote on last edited by
              #26

              @alexsh1 said:

              float siVolt = vcc / 1000;
              

              You should change 1000 to 1000.0, i.e. a float. Float math will be used if any of the operands is a float.
              https://www.arduino.cc/en/Reference/Arithmetic

              1 Reply Last reply
              0
              • alexsh1A Offline
                alexsh1A Offline
                alexsh1
                wrote on last edited by
                #27

                @martinhjelmare Stupid me! Thanks for bringing this up - these issues are so simple, but very easy to overlook. I was about to start pulling my hair out....

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                7

                Online

                11.7k

                Users

                11.2k

                Topics

                113.0k

                Posts


                Copyright 2019 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