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. Redefinition warning when Compiling for RFM69W-915 Radio

Redefinition warning when Compiling for RFM69W-915 Radio

Scheduled Pinned Locked Moved Development
4 Posts 2 Posters 698 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.
  • JohnRobJ Offline
    JohnRobJ Offline
    JohnRob
    wrote on last edited by JohnRob
    #1

    Hi,
    I'm working on my first MySensors Node. My code is a simple read an analog input function. Now because my radio is a 915MHz version I must add a line to state such. When I do the compiler gives me a warning "warning: "MY_RFM69_FREQUENCY" redefined"

    Now I know I am redefining the default radio frequency so the warning is understood, however I am wondering if I am coding is a clumsy manor to get this warning.
    My Code:

    // Sensor node code
    // 2018-01-26  V_01b
    // Target: Aarduino MiniWirelessW-915
    //MySensors API V2.2.0
    // from:  https://www.mysensors.org/download/sensor_api_20
    
    
    #define MY_DEBUG
    // *** Initialization *** //
    #define MY_RADIO_RFM69
    #include <MySensors.h>
    
    #define MY_RFM69_FREQUENCY RF69_915MHZ
    #define CHILD_ID 5
    #define sensortype S_MULTIMETER
    #define analoginputPIN A0
    #define LEDPIN 9 //PB1 is pin 9 on ProMini
    
    uint16_t analogPinRdg;
    
    MyMessage msg_Voltage(CHILD_ID, V_VOLTAGE);
    
    void setup()
    {
    pinMode(LEDPIN, OUTPUT);
    digitalWrite(LEDPIN, HIGH);   // turn the LED on (doesn't work, may not get here)
    }
    
    void presentation()
    {
      present(CHILD_ID, S_MULTIMETER);
    }
    
    
    void loop()
    {
      
    //  digitalWrite(LEDPIN, HIGH);   // turn the LED on (HIGH is the voltage level)
    //  delay(1000);                       // wait for a second
    //  digitalWrite(LEDPIN, LOW);    // turn the LED off by making the voltage LOW
        delay(1000);                       // wait for a second
      
      asm ("sbi %0, %1 \n": : "I" (_SFR_IO_ADDR(PINB)), "I" (PINB1)); // Toggle LED
      analogPinRdg = analogRead(analoginputPIN);
      send(msg_Voltage.set(analogPinRdg));
      
    
      wait(5000);    //unsigned long 
    }```
    mfalkviddM 1 Reply Last reply
    0
    • JohnRobJ JohnRob

      Hi,
      I'm working on my first MySensors Node. My code is a simple read an analog input function. Now because my radio is a 915MHz version I must add a line to state such. When I do the compiler gives me a warning "warning: "MY_RFM69_FREQUENCY" redefined"

      Now I know I am redefining the default radio frequency so the warning is understood, however I am wondering if I am coding is a clumsy manor to get this warning.
      My Code:

      // Sensor node code
      // 2018-01-26  V_01b
      // Target: Aarduino MiniWirelessW-915
      //MySensors API V2.2.0
      // from:  https://www.mysensors.org/download/sensor_api_20
      
      
      #define MY_DEBUG
      // *** Initialization *** //
      #define MY_RADIO_RFM69
      #include <MySensors.h>
      
      #define MY_RFM69_FREQUENCY RF69_915MHZ
      #define CHILD_ID 5
      #define sensortype S_MULTIMETER
      #define analoginputPIN A0
      #define LEDPIN 9 //PB1 is pin 9 on ProMini
      
      uint16_t analogPinRdg;
      
      MyMessage msg_Voltage(CHILD_ID, V_VOLTAGE);
      
      void setup()
      {
      pinMode(LEDPIN, OUTPUT);
      digitalWrite(LEDPIN, HIGH);   // turn the LED on (doesn't work, may not get here)
      }
      
      void presentation()
      {
        present(CHILD_ID, S_MULTIMETER);
      }
      
      
      void loop()
      {
        
      //  digitalWrite(LEDPIN, HIGH);   // turn the LED on (HIGH is the voltage level)
      //  delay(1000);                       // wait for a second
      //  digitalWrite(LEDPIN, LOW);    // turn the LED off by making the voltage LOW
          delay(1000);                       // wait for a second
        
        asm ("sbi %0, %1 \n": : "I" (_SFR_IO_ADDR(PINB)), "I" (PINB1)); // Toggle LED
        analogPinRdg = analogRead(analoginputPIN);
        send(msg_Voltage.set(analogPinRdg));
        
      
        wait(5000);    //unsigned long 
      }```
      mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by
      #2

      @johnrob all defines for MySensors need to be done before including MySensors.h. Otherwise, they won't have any effect.

      So move define MY_RFM69_FREQUENCY RF69_915MHZ a few lines up.

      1 Reply Last reply
      0
      • JohnRobJ Offline
        JohnRobJ Offline
        JohnRob
        wrote on last edited by
        #3

        @mfalkvidd said in Redefinition warning when Compiling for RFM69W-915 Radio:

        MySensors.h

        Thank you.

        I was under the impression that the RFM69 default frequency was 868Mhz and if I placed the "#define MY_RFM69_FREQUENCY RF69_915MHZ" before the MySensors.h the frequency would be reset to 868.

        I'm guessing by your answer that this is not the case. Perhaps an if not defined.

        mfalkviddM 1 Reply Last reply
        0
        • JohnRobJ JohnRob

          @mfalkvidd said in Redefinition warning when Compiling for RFM69W-915 Radio:

          MySensors.h

          Thank you.

          I was under the impression that the RFM69 default frequency was 868Mhz and if I placed the "#define MY_RFM69_FREQUENCY RF69_915MHZ" before the MySensors.h the frequency would be reset to 868.

          I'm guessing by your answer that this is not the case. Perhaps an if not defined.

          mfalkviddM Offline
          mfalkviddM Offline
          mfalkvidd
          Mod
          wrote on last edited by
          #4

          @johnrob exactly. All MySensors defines are designed that way.

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


          13

          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