บทความ

กำลังแสดงโพสต์จาก ตุลาคม, 2018

Mini Project

รูปภาพ
เปิดพัดลมอัตโนมัติด้วยอุณหภูมิ อุปกรณ์ 1.Arduino 1 ตัว 2.พัดลมคอม 1 ตัว 3.LCD 1 ตัว 4.ไดฟ์มอเตอร์ 1 ตัว 5เซนเซอร์วัดอุณหภูมิ 1 ตัว Wiring diagram  Block Diagram Code #include "DHT.h" เรียกใช้ไลซ์เบอรี่ DHT #include <LiquidCrystal_I2C.h> เรียกใช้ไลซ์เบอรี่ LiquidCrystal_I2C #define DHTPIN 2 // what pin we're connected to #define DHTTYPE DHT22 // DHT 22 (AM2302) #define fan 4 int maxTemp = 32; DHT dht(DHTPIN, DHTTYPE); LiquidCrystal_I2C lcd(0x27,20,4); void setup() { lcd.init(); lcd.backlight(); lcd.print(" PROJECT BALLY"); delay(3000); lcd.clear(); pinMode(fan, OUTPUT); Serial.begin(9600); dht.begin(); } void loop() { delay(2000); float t = dht.readTemperature(); lcd.setCursor(0, 0); lcd.print(" T: "); lcd.print(t); lcd.print(" *C "); if ( isnan(t)) { Serial.println("Failed to read from DHT sensor!"); return; } i

นายศุภวิชญ์ ทิพย์ศรีบุญ ปรับแก้คะแนนครับ

รูปภาพ
แก้คะแนนครับ How To Make Arduino Based Home Automation Project via Bluetooth? HARDWARE 1. Arduino uno r3 2. Hc-05 bluetooth Module 3. Reldy 4. Load 5. Res 6. 2N2222 7. 1N4007 INPUT 1.Telephon 2.Hc-05 bluetooth Module MCU 1.Arduino uno r3 OUTPUT 1.Relay 2.Load CODE #include <SoftwareSerial.h> กำหนดเรียกใช้ใน ไลบรารี่ Bluetooth   const int rxPin = 4; กำหนดไปที่ rxPin ขา 4 const int txPin = 2;               กำหนดไปที่ txPin ขา 2       SoftwareSerial mySerial(rxPin, txPin); ไว้ใช้กำหนดค่าลงใน ไลบรารี่ Bluetooth const int Loads[] = {9, 10, 11, 12}; ตัวแปรอาเรย์ int state = 0; นี่คือตัวแปล state = 0 int flag = 0; นี่คือตัวแปล flag = 0 void setup() เป็นฟังก์ชั่นแรกที่เมื่อ Arduino ทำงานแล้วจะเรียกเพื่อทำการ setup ค่าตามจุดประสงค์ของฟังก์ชั่น   {    for (int i=0;i<4;i++) int=0<4 และ i+ เรื่อยๆ