บทความ

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

งานแก้ปรับคะแนน

รูปภาพ
ส่วนประกอบArduino Based Home Automation Project via Bluetooth 1ฮาร์ดแวร์    1.1 input              - Arduino UNO  R3                 - HC – 05 Bluetooth Module            -smartphone    1.2 output           -load 2.ซอฟแวร์ อธิบายโค้ดทั้งฟังก์ชั่นของarduinoเองและฟังก์ชั่นพิเศษ #include <SoftwareSerial.h>//เรียกใช้งาน const int rxPin = 4;// ตัวแปร txPin มีค่าเป็น 4 const int txPin = 2;//ตัวแปร txPin มีค่าเป็น 2 SoftwareSerial mySerial(rxPin, txPin);// ฟังก์ชั่นของ SoftwareSeria const int Loads[] = {9, 10, 11, 12};/ตัวแปร Loads มีค่า เป็น(9,10,11,12) int state = 0;//ตัวแปร start มีค่าเป็น 0 int flag = 0; ตัวแปร flag มีค่าเป็น 0 void setup()//ค่าเริ่มต้น {    for (int i=0;i<4;i++)//กำหนดตัวแปร i=0,iน้อยกว่า4 เพิ่มทีละ1     {       pinMode(Loads[i], OUTPUT);//L...