Co jest nie tak

greg54
Posty: 17
Rejestracja: czw sty 21, 2016 10:49 am

Hej staram się uruchomić termometr DS18B20 :

#include <OneWire.h>
#include <DallasTemperature.h>
OneWire temp(7);
DallasTemperature DS18(&temp);

void setup()
{
Serial.begin(9600);
DS18.begin();
}
void loop()
{
DS18.requestTemperatures();
Serial.print("DS18 numer 1: ");
Serial.println(DS18.getTempCByIndex(0));
Serial.print("DS18 numer 2: ");
Serial.println(DS18.getTempCByIndex(1));
Serial.print("\r\n");
delay(2000);
}


i ciągle mi wyświetla -127.00 co mam nie tak ?
Awatar użytkownika
pzygmunt
Posty: 18335
Rejestracja: wt sty 19, 2016 9:26 am
Lokalizacja: Paczków
Kontakt:

Może źle je podłączyłeś.
Twój kod wygląda na poprawny. Tu masz działający przykład.
https://github.com/SUPLA/arduino/blob/m ... rature.ino
greg54
Posty: 17
Rejestracja: czw sty 21, 2016 10:49 am

dziwne bo jak podlacze ESP01 na Twoim sofcie to czujnik działa: gate_module_ESP01_ds_eagle
ODPOWIEDZ

Wróć do „Pomoc”