• Witaj na Forum Arduino Polska! Zapraszamy do rejestracji!
  • Znajdziesz tutaj wiele informacji na temat hardware / software.
Witaj! Logowanie Rejestracja


Ocena wątku:
  • 0 głosów - średnia: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Kilka czujników temp. + termostat 2-przekaznikowy
#10
Przy tych ustawieniach dobrze pokazuje na monitorze portów ale na wyświetlaczu 0.00
Woda: 47.81
Powietrze: 21.81
C = 27.50
Woda: 47.81
Powietrze: 21.81
C = 28.00


Kod PHP:
#include <LiquidCrystal_I2C.h>
#include <Wire.h>  //
#include <OneWire.h>
#include <DallasTemperature.h>
#include <DS18B20.h>
#include "max6675.h"
 //Definicje, definicje:
 #define SO_PIN  2  // 6675 Serial Output
#define CS_PIN  3  // 6675 Chip Select
#define CK_PIN  4  // 6675 Clock Pin

#define TOO_HOT  75.0  // To try limit calculation
#define TOO_COLD 62.5 
MAX6675 thermocouple(CK_PINCS_PINSO_PIN);
LiquidCrystal_I2C lcd(0x3F21045673POSITIVE);

OneWire oneWire(7); //Podłączenie do 7
DallasTemperature sensors(&oneWire); //Przekazania informacji do biblioteki
float DegreesC;
DeviceAddress a = { 0x280xFF0x6E0xE50x330x160x40x2E };
DeviceAddress b = { 0x280xFF0x30xE70x330x160x40xD4 };

void setup(void) {
 
 Serial.begin(9600);
 
 
  sensors
.begin(); //Inicjalizacja czujnikow
 
lcd.begin(162); //Deklaracja typu
 
lcd.setCursor(0,0);
 
lcd.print("W=");
 
lcd.print(sensors.getTempCByIndex(0));
 
  lcd.setCursor(0,1);
 
lcd.print("P=");
 
lcd.print(sensors.getTempCByIndex(1));
 
lcd.setCursor(8,1);
 
lcd.print("C=");
lcd.print(DegreesC);
}
 
void loop(void) { 
 
 sensors.requestTemperatures(); //Pobranie temperatury czujnika
 
 Serial.print("Woda: ");
 
 Serial.println(sensors.getTempCByIndex(0));  //Wyswietlenie informacji
 
 delay(500);
 
 Serial.print("Powietrze: ");
 
 Serial.println(sensors.getTempCByIndex(1));  //Wyswietlenie informacji
 
 delay(500);
 
 Serial.print("C = "); 
 
 Serial.println(DegreesC);
 
 DegreesC thermocouple.readCelsius();
 
 delay(250);

 
Odpowiedź
  


Wiadomości w tym wątku
RE: Kilka czujników temp. + termostat 2-przekaznikowy - przez Minek3 - 12-03-2017, 14:07

Skocz do:


Przeglądający: 2 gości