Forum Rule: Always post complete source code & details to reproduce any issue!
-
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)); //
}
-
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
-
thank you! any other errors?

Originally Posted by
mlu
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
Thank you so much! DId you happen to see any other problems with the code?
-
Senior Member
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
-
Forum Rules