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. Troubleshooting
  3. MySensors_Sprinkler:174: error: 'POSITIVE' was not declared in this scope

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

Scheduled Pinned Locked Moved Troubleshooting
7 Posts 4 Posters 1.2k Views 4 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.
  • M Offline
    M Offline
    mrhutchinsonmn
    wrote on last edited by
    #1

    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```
    skywatchS mfalkviddM 2 Replies Last reply
    0
    • M mrhutchinsonmn

      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```
      skywatchS Offline
      skywatchS Offline
      skywatch
      wrote on last edited by
      #2

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

      1 Reply Last reply
      0
      • M mrhutchinsonmn

        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```
        mfalkviddM Offline
        mfalkviddM Offline
        mfalkvidd
        Mod
        wrote on last edited by
        #3

        @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.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mrhutchinsonmn
          wrote on last edited by
          #4

          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.

          mfalkviddM 1 Reply Last reply
          0
          • M mrhutchinsonmn

            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.

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

            @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.

            1 Reply Last reply
            0
            • R Offline
              R Offline
              rjspindler
              wrote on last edited by
              #6

              @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.

              1 Reply Last reply
              1
              • M Offline
                M Offline
                mrhutchinsonmn
                wrote on last edited by
                #7

                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!

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


                19

                Online

                11.7k

                Users

                11.2k

                Topics

                113.0k

                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