MySensors_Sprinkler:174: error: 'POSITIVE' was not declared in this scope



  • I have researched this error on the forum but I am not clear how to resolve. From other answers Positive is supposed to be declared. I have the mysensors library installed (2.3.1) and using Arduino IDE 1.8.5

    "/home/raymond/Downloads/arduino-1.8.5/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR   "-I/home/raymond/Downloads/arduino-1.8.5/hardware/arduino/avr/cores/arduino" "-I/home/raymond/Downloads/arduino-1.8.5/hardware/arduino/avr/variants/eightanaloginputs" "-I/home/raymond/Downloads/arduino-1.8.5/hardware/arduino/avr/libraries/Wire/src" "-I/home/raymond/Arduino/libraries/Time-master" "-I/home/raymond/Downloads/arduino-1.8.5/hardware/arduino/avr/libraries/SPI/src" "-I/home/raymond/Arduino/libraries/MySensors" "-I/home/raymond/Arduino/libraries/LiquidCrystal/src" "-I/home/raymond/Arduino/libraries/LiquidCrystal_I2C-1.1.2" "/tmp/arduino_build_167561/sketch/MySensors_Sprinkler.ino.cpp" -o "/tmp/arduino_build_167561/sketch/MySensors_Sprinkler.ino.cpp.o"
    MySensors_Sprinkler:174: error: 'POSITIVE' was not declared in this scope
     LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);  // Set the LCD I2C address to 0x27
                                                         ^
    Using library Wire at version 1.0 in folder: /home/raymond/Downloads/arduino-1.8.5/hardware/arduino/avr/libraries/Wire 
    Using library Time-master at version 1.5 in folder: /home/raymond/Arduino/libraries/Time-master 
    Using library SPI at version 1.0 in folder: /home/raymond/Downloads/arduino-1.8.5/hardware/arduino/avr/libraries/SPI 
    Using library MySensors at version 2.3.1 in folder: /home/raymond/Arduino/libraries/MySensors 
    Using library LiquidCrystal at version 1.0.7 in folder: /home/raymond/Arduino/libraries/LiquidCrystal 
    Using library LiquidCrystal_I2C-1.1.2 at version 1.1.2 in folder: /home/raymond/Arduino/libraries/LiquidCrystal_I2C-1.1.2 
    exit status 1
    'POSITIVE' was not declared in this scope```


  • @mrhutchinsonmn I think you need to post the full code, and LCD library version, unless it is secret (but then nobody can help you)..


  • Mod

    @mrhutchinsonmn could you tell us where you found this MySensors_Sprinkler? It is not part of the MySensors library, nor part of the MySensors external examples so it is a bit hard to know what code you are using.



  • My apologies... I should have mentioned that I am using your sketch from the Irrigation controller project. Nothing has been changed (just copy and paste) (https://www.mysensors.org/build/irrigation). Renamed it for my garden sprinkler project. I am not near my Desktop PC till Monday, so I am not sure where I found the library. Is there a specific library version I should use? Where will I find it? From reviewing other questions on this subject, it seemed you felt everything needed would be found in the mysensors library. Maybe I misunderstood.


  • Mod

    @mrhutchinsonmn thanks for explaining.

    You'll need the exact versions available in https://github.com/mysensors/MySensorsArduinoExamples/archive/master.zip

    Unfortunately, the install process is a bit more complex than the normal MySensors library install. You'll need to unzip the file and move the libraries (the individual libraries, not the libraries folder itself) into the Arduino IDE's library folder. You might have to uninstall existing versions of the libraries first.



  • @mrhutchinsonmn , we just recently had the exact same problem. It all about versions of files. I don't know if the MySensors library version is critical. But the external examples libraries were the key for us. In the Demonstration section of the project it says:

    NOTE: The code referenced in this video is out of date. Please use the code below with the current MySensors library and the libraries included in the MySensors external examples. Please install the libraries and restart the Arduino IDE before trying to compile.

    In that Examples library referenced, you need the version of the Liquid Crystal library. That version defines POSITIVE and hopefully will get you to compile successfully.



  • Yes, that worked... I downloaded master.zip and replaced the current Liquid Crystal folder with the new one. Restarted IDE and was able to compile and upload the sketch. Thank you!


Log in to reply
 

Suggested Topics

  • 3
  • 2
  • 1
  • 6
  • 6

14
Online

11.4k
Users

11.1k
Topics

112.7k
Posts