Comments (6)
Can you print getDeviceCount(void); just before setResolution();
What does it return?
(please post your modified sketch)
from arduino-temperature-control-library.
Hi Rob,
getDeviceCount() returns 0.
Here a part of my sketch:
#include "FreqPeriod.h"
#include <LiquidCrystal.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 10 // Pin 10 One Wire
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature DS18B20(&oneWire);
double lfrq;
long int pp;
float vitesseVent, vitesseVentMax;
float tempExt, tempExtMax, tempExtMin;
char buffer[15];
void setup() {
Serial.begin(115200);
FreqPeriod::begin();
lcd.begin(16,2);
lcd.print("Station meteo");
delay(2000);
lcd.clear();
DS18B20.setResolution(12);
DS18B20.requestTemperatures();
tempExt = DS18B20.getTempCByIndex(0);
tempExtMax=tempExt;
tempExtMin=tempExt;
}
void loop() {
// Serial.println (DS18B20.getDeviceCount());
DS18B20.setResolution(9);
DS18B20.requestTemperaturesByIndex(0); // Send the command to get temperatures
tempExt = DS18B20.getTempCByIndex(0); // on récupère les temps. par index de capteurs
if (tempExt < tempExtMin) {
tempExtMin = tempExt;
}
if (tempExt > tempExtMax) {
tempExtMax = tempExt;
}
}
from arduino-temperature-control-library.
I think your sketch is missing
DS18B20.begin();
call before the setResolution
give it a try
from arduino-temperature-control-library.
Hi Rob,
You were perfectly right !
How could i have overlook this ??
Sorry for bandwidth and thanks for the help, all works perfectly now.
Patrick.
from arduino-temperature-control-library.
Everyone is blind for his/her own code ;)
@milesburton
please close issue
from arduino-temperature-control-library.
Thanks again and keep up the good job !
Cheers,
from arduino-temperature-control-library.
Related Issues (20)
- DEVICE_DISCONNECTED_C as -255 exceeds int8_t storage HOT 11
- -127.00 c° When start a fan HOT 16
- DS18S20 does not work on parasitic power. HOT 3
- Disconnected sensor messes up sensor indices HOT 4
- getAddress return the first address available even if not found the device HOT 2
- 18B20: blocking time to time HOT 16
- `getAddresses` additional to `getAddress(uint8_t* deviceAddress, uint8_t index)` HOT 1
- Bug: `DallasTemperature::readPowerSupply(const uint8_t* deviceAddress)` sends reset at end of command
- Update Licensing HOT 3
- bug: sensor (DS18S20) is considered disconnected when reporting the lowest temperature (-55 deg C) HOT 8
- bug: release should be created whenever merge to master happens HOT 3
- Feature request - add sensors.reset()
- warning: type 'struct DallasTemperature' violates the C++ One Definition Rule [-Wodr] HOT 4
- Additional documentation website cannot be reached
- Problem in 2.0.4 and ESP32-S3 HOT 1
- [DS18B20] Beware of batch 2034C4 and batch 2213C4, non-standard times.
- ESP32-S2 not finding DS18B20 HOT 8
- Arduino nano esp32 not findiding DS18B20 HOT 2
- Is there a conflict with Toggle library? HOT 5
- Location for MAX31825 HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arduino-temperature-control-library.