Code Monkey home page Code Monkey logo

Comments (6)

RobTillaart avatar RobTillaart commented on June 2, 2024

Can you print getDeviceCount(void); just before setResolution();

What does it return?

(please post your modified sketch)

from arduino-temperature-control-library.

tk5ep avatar tk5ep commented on June 2, 2024

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.

 avatar commented on June 2, 2024

I think your sketch is missing

DS18B20.begin();

call before the setResolution

give it a try

from arduino-temperature-control-library.

tk5ep avatar tk5ep commented on June 2, 2024

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.

RobTillaart avatar RobTillaart commented on June 2, 2024

Everyone is blind for his/her own code ;)

@milesburton
please close issue

from arduino-temperature-control-library.

tk5ep avatar tk5ep commented on June 2, 2024

Thanks again and keep up the good job !

Cheers,

from arduino-temperature-control-library.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.