clean up the serial output. and show F instead of C.

This commit is contained in:
Roald Batts 2022-12-28 22:58:04 -05:00
parent 8bd54f6e73
commit 7d9d691fc6

View file

@ -10,7 +10,7 @@
DHT dht(DHT11_PIN, DHT11);
volatile int buttonState;
volatile int value = 0;
volatile int lightValue = 0;
int count;
LiquidCrystal_I2C lcd(0x27, 16, 2);
@ -29,38 +29,40 @@ void setup()
lcd.setCursor(0,1);
lcd.printstr("hello, Roald!");
dht.begin();
dht.begin(20);
Serial.print("done setting up!\n");
}
void loop()// the loop function runs over and over again forever
{
Serial.print("[");
Serial.print(count);
Serial.print("] hey\n");
//Serial.print("[");
//Serial.print(count);
//Serial.print("] hey\n");
lightValue = analogRead(photos);
if (lightValue > 300){
digitalWrite(LED, HIGH);
}
else{
digitalWrite(LED, LOW);
}
float hum;
float temp;
temp = dht.readTemperature();
hum = dht.readHumidity();
{
Serial.print("humidity:");
Serial.print("humidity: ");
Serial.print(hum);
Serial.print(" temperature:");
Serial.println(temp);
delay(200);
Serial.print(" temperature: ");
Serial.print(dht.convertCtoF(temp));
Serial.print(" light: ");
Serial.println(lightValue);
delay(50);
}
value = analogRead(photos);
Serial.println(value);
if (value > 300){
digitalWrite(LED, HIGH);
}
else{
digitalWrite(LED, LOW);
}
delay(100);
//delay(100);
//blink();
@ -71,9 +73,9 @@ void loop()// the loop function runs over and over again forever
} else {
digitalWrite(LED, LOW);
}
delay(100);
//delay(100);
count++;
//count++;
}
void birthdaySong() {