FarukS
Kilopat
- Katılım
- 5 Ağustos 2018
- Mesajlar
- 1.865
- Makaleler
- 1
- Çözümler
- 4
Daha fazla
- Cinsiyet
- Erkek
Merhabalar, arduino ile termokupl yapma ödevimde 40 derece altında 2x16 LED ekranda sorunlar oluşuyor. 40 derece üstü normal çalışırken 40 derecenin altına düşünce ekranda soluklaşma ve derece okumamaya başlıyor. Yardımcı olabilir misiniz?
Kod:
#include <max6675.h>
#include <LiquidCrystal.h>
#include <Wire.h>
int thermoDO = 6;
int thermoCS = 7;
int thermoCLK = 8;
int led1=9;
int led2=10;
MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
uint8_t degree[8] = {140,146,146,140,128,128,128,128};
void setup() {
Serial.begin(9600);
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
lcd.begin(16, 2);
lcd.createChar(0, degree);
delay(500);
}
void loop() {
// basic readout test, just print the current temp
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Sicaklik Test");
lcd.setCursor(0,1);
lcd.print(thermocouple.readCelsius());
#if (ARDUINO >= 100)
lcd.write((byte)0);
#else
lcd.print(0, BYTE);
#endif
lcd.print("C");
if (thermocouple.readCelsius()<30&&thermocouple.readCelsius()>=0){
lcd.print("=normal=");
}
if (thermocouple.readCelsius()>30&&thermocouple.readCelsius()<=40){
lcd.print("=sicak=");
digitalWrite(led1, LOW);
digitalWrite(led2, HIGH);
}
if (thermocouple.readCelsius()>40){
lcd.print("=coksicak=");
digitalWrite(led1, HIGH);
digitalWrite(led2, LOW);
delay(1000);
}
}