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. Getting childId from IncomingMessage

Getting childId from IncomingMessage

Scheduled Pinned Locked Moved Development
6 Posts 4 Posters 3.3k 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.
  • B Offline
    B Offline
    bluman
    wrote on last edited by
    #1

    Hi there guys,

    I'm not a coder and struggling to expand the LED dimmer example to work as a three channel RGB driver.

    Could someone please show me how to extract the childId in the message received from the gateway?

    Any help is greatly appreciated. Here is what I'm trying to do:

    void incomingMessage(const MyMessage &message) {
    if (message.type == V_DIMMER && message.childId = 0) {

    hekH 1 Reply Last reply
    0
    • B bluman

      Hi there guys,

      I'm not a coder and struggling to expand the LED dimmer example to work as a three channel RGB driver.

      Could someone please show me how to extract the childId in the message received from the gateway?

      Any help is greatly appreciated. Here is what I'm trying to do:

      void incomingMessage(const MyMessage &message) {
      if (message.type == V_DIMMER && message.childId = 0) {

      hekH Offline
      hekH Offline
      hek
      Admin
      wrote on last edited by
      #2

      @bluman said:

      message.childId = 0

      You're doing an assignment here. Should probably be ==

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bluman
        wrote on last edited by
        #3

        Hek,

        OK, thanks for that however it still wont compile.

        void incomingMessage(const MyMessage &message) {
        if (message.type == V_DIMMER && message.childId == 0) {

        Here is the error.

        _150309_RBG_LED_Driver.ino: In function ‘void incomingMessage(const MyMessage&)’:
        _150309_RBG_LED_Driver.ino:82:43: error: ‘const class MyMessage’ has no member named ‘childId’

        V 1 Reply Last reply
        0
        • hekH Offline
          hekH Offline
          hek
          Admin
          wrote on last edited by
          #4

          https://github.com/mysensors/Arduino/blob/master/libraries/MySensors/MyMessage.h#L189

          1 Reply Last reply
          0
          • B bluman

            Hek,

            OK, thanks for that however it still wont compile.

            void incomingMessage(const MyMessage &message) {
            if (message.type == V_DIMMER && message.childId == 0) {

            Here is the error.

            _150309_RBG_LED_Driver.ino: In function ‘void incomingMessage(const MyMessage&)’:
            _150309_RBG_LED_Driver.ino:82:43: error: ‘const class MyMessage’ has no member named ‘childId’

            V Offline
            V Offline
            vikasjee
            wrote on last edited by vikasjee
            #5

            @bluman said:

            Hek,

            OK, thanks for that however it still wont compile.

            void incomingMessage(const MyMessage &message) {
            if (message.type == V_DIMMER && message.childId == 0) {

            Here is the error.

            _150309_RBG_LED_Driver.ino: In function ‘void incomingMessage(const MyMessage&)’:
            _150309_RBG_LED_Driver.ino:82:43: error: ‘const class MyMessage’ has no member named ‘childId’

            Use message.sensor == 0

            BulldogLowellB 1 Reply Last reply
            0
            • V vikasjee

              @bluman said:

              Hek,

              OK, thanks for that however it still wont compile.

              void incomingMessage(const MyMessage &message) {
              if (message.type == V_DIMMER && message.childId == 0) {

              Here is the error.

              _150309_RBG_LED_Driver.ino: In function ‘void incomingMessage(const MyMessage&)’:
              _150309_RBG_LED_Driver.ino:82:43: error: ‘const class MyMessage’ has no member named ‘childId’

              Use message.sensor == 0

              BulldogLowellB Offline
              BulldogLowellB Offline
              BulldogLowell
              Contest Winner
              wrote on last edited by
              #6

              @vikasjee

              you should post your entire sketch... put between three backticks (the character left of your "1" key on you keyboard

              <three backticks>
              your code
              <three backticks>

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


              15

              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