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. Development
  3. gw.sendVariable - library question

gw.sendVariable - library question

Scheduled Pinned Locked Moved Development
4 Posts 3 Posters 19 Views 3 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.
  • pw44P Offline
    pw44P Offline
    pw44
    wrote on last edited by
    #1

    Hi,

    getting an example, gw.sendVariable was not recognized and i could not find it.

    Any hint?

    1 Reply Last reply
    0
    • boumB Offline
      boumB Offline
      boum
      wrote on last edited by
      #2

      You should post the code you're trying to compile. But it looks like it is using an older version of MySensors. The object model with Sensor gw is deprecated now.
      To send values to the gateway, you should use MyMessage messageName(CHILD_ID, V_type_of_message);

      pw44P 1 Reply Last reply
      1
      • boumB boum

        You should post the code you're trying to compile. But it looks like it is using an older version of MySensors. The object model with Sensor gw is deprecated now.
        To send values to the gateway, you should use MyMessage messageName(CHILD_ID, V_type_of_message);

        pw44P Offline
        pw44P Offline
        pw44
        wrote on last edited by
        #3

        @boum thx, man. i was in doubt, so you confirmed that it's deprecated.

        i was following the code:

        void loop() {     
          // Read digital motion value
          boolean motion = digitalRead( DIGITAL_INPUT_SENSOR ) == LOW; 
        
          // Send debug output to serial monitor
          mprintln(PSTR("Motion sensor %s"), motion ? "ON" : "OFF" );
        
          if (lastMotion != motion) {
            lastMotion = motion;
        
            // Send motion value to sensor
            gw.send( msg.set( motion ? "1" : "0" ) );
          
            if (motion) {
              gw.sleep( SLEEP_TIME );
            }
          }
          
          gw.sleep( INTERRUPT, CHANGE, SLEEP_TIME );
        }
        

        to use the motion sensor without interrupt (pin 2 or 3).

        1 Reply Last reply
        0
        • mfalkviddM Online
          mfalkviddM Online
          mfalkvidd
          Mod
          wrote on last edited by
          #4

          A guide for converting sketches using MySensors 1.5 to MySensors 2 is available at https://forum.mysensors.org/topic/4276/converting-a-sketch-from-1-5-x-to-2-0-x

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


          18

          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