int servoPin = 6;
int ledPin = 13;
int buttonPin = 12;
int potentiometerPin = A0;
int dhtPin = 2;
#include <Servo.h>
#include <DHT.h>
#include <LiquidCrystal_I2C.h>
Servo myServo;
DHT dht(dhtPin, DHT22);
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
pinMode(ledPin, OUTPUT);
pinMode(buttonPin, INPUT);
myServo.attach(servoPin);
dht.begin();
lcd.init();
lcd.backlight();
}
void loop() {
if (digitalRead(buttonPin)==HIGH{
digitalWrite(ledPin, HIGH);
} else{
digitalWrite(ledPin, LOW);
}
int potValue = analogRead(potentiometerPin);
int angle = map (potValue, 0, 1023, 0, 180);
myServo.write(angle)
float temp = dht. readTemeratur();
String tempString = "temp:" + String(temp) + "C";
lcd.clear();
lcd.setCursor(0,0);
lcd.print(tempString);
delay(500);
}