งานที่18
Code #include <SoftwareSerial.h> #include <DHT11.h> //============================================= #include <Wire.h> #include <LiquidCrystal_I2C.h> //LiquidCrystal_I2C lcd(0x27, 16, 2); LiquidCrystal_I2C lcd(0x3F, 16, 2); SoftwareSerial ArduinoSerial(3, 2); // RX, TX //============================================= int SW_ON = 4,SW_OFF = 5,pin=6;//กำหนดขา INPUT int Sun = 9,CSun = 0,Relay1 = 12, Relay2 = 11; //กำหนดขา OUTPUT int ATL = A0,ATH = A1;//กำหนดขา Analog int VTL1 = 0,VTH1 = 0,TL = 0,TH =0,VRHL = 50,VRHH = 80; DHT11 dht11(pin); //============================================= void setup() { lcd.begin(); Serial.begin(115200); ArduinoSerial.begin(4800); while (!Serial){ ; } //===================================================== lcd.setCursor(0, 0);lcd.print("Elec Pattayatech"); lcd.setCursor(0, 1);lcd.print("Smart Farm 2016 "); delay(5000);