Redefinition warning when Compiling for RFM69W-915 Radio
-
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 }``` -
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 }``` -
@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.
-
@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.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login