Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: Category 'Sensor' in library DallasTemperature is not valid

  1. #1
    Junior Member
    Join Date
    Jul 2015
    Posts
    2

    Category 'Sensor' in library DallasTemperature is not valid

    Hi! I'm new to Arduino (and programming in general). I'm currently working on how to connect a DS18B20 to a Moteino. I can't understand why but the category "sensor" isn't valid in the DallasTemperature library. I have tried uninstalling and re-installing it but I continue getting the same result.

    I'm sorry if this question seems unintelligent, but I'm just starting out and would appreciate any help!

    Here is my code:

    #include <OneWire.h>
    #include <DallasTemperature.h>


    #define ONE_WIRE_BUS 14


    // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
    OneWire
    oneWire(ONE_WIRE_BUS);


    DallasTemperature sensors(&oneWire);

    void setup(void)

    Serial.begin(9600);
    Serial.println("Dallas Temperature IC Control Library Demo");

    sensors.begin(); // IC Default 9 bit. If you have troubles consider upping it 12. Ups the delay giving the IC more time to process the temperature measurement

    }


    void loop(void)
    {
    Serial.print("Requesting temperatures...");
    sensors.requestTemperatures(); // Send the command to get temperatures
    Serial.println("DONE");

    Serial.print("Temperature for Device 1 is: ");
    Serial.print(sensors.getTempCByIndex(0)); //
    }

  2. #2
    Senior Member
    Join Date
    Aug 2013
    Location
    Gothenburg, Sweden
    Posts
    415
    The warning about category "sensors" is just a minor issue with the library manager.

    But your code needs an opening brace after "void setup(void)"

    it should be

    Code:
    void setup(void)
    {

  3. #3
    Junior Member
    Join Date
    Jul 2015
    Posts
    2

    thank you! any other errors?

    Quote Originally Posted by mlu View Post
    The warning about category "sensors" is just a minor issue with the library manager.

    But your code needs an opening brace after "void setup(void)"

    it should be

    Code:
    void setup(void)
    {
    Thank you so much! DId you happen to see any other problems with the code?

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    27,675
    Since you're using a Moteino board, maybe post here:

    https://lowpowerlab.com/forum/index.php?board=1.0

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •