15:18
0

1. เปิดโปรแกรม Arduino ที่ได้โหลดมาจาก http://arduino.cc/en/Main/Software
2. เมื่อเปิดโปรแกรมแล้วจะพบกับหน้าต่างของ IDE ดังรูป
3. ไปที่ Tools->Board แล้วเลือกให้ตรงกับบอร์ดที่ใช้งาน สำหรับ Arduino UNO R3 ให้เลือกบอร์ด Arduino UNO
4. เขียนโปรแกรมดังข้อความด้านล่างนี้
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*
  Arduino "Hello world"
   
  This example code is in www.EC.in.th.
  */
// the setup routine runs once when you press reset:
void setup() {
   // initialize serial communication at 9600 bits per second:
   Serial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop() {
   // print out the value you read:
   Serial.print("Hello World\n\r");
}
5. จากนั้นคอมไฟล์โปรแกรมโดยไปที่ Sketch->Verify / Compile
6. เมื่อคอมไฟล์เรียบร้อยจะมีข้อความปรากฎดังรูป
7. ต่อบอร์ด Arduino UNO R3 เข้ากับคอมพิวเตอร์ผ่านทางพอร์ต USB
8. จากนั้นให้ไปที่ Tools->Serial Port และเลือกให้ตรงกับบอร์ด Arduino UNO ที่ใช้งาน (สำหรับบอร์ด Arduino UNO R3 โปรแกรมจะเลือกให้อัตโนมัติ)
9. โหลดโปรแกรมเข้าบอร์ด Arduino UNO โดยไปที่ File->Upload
10. จากนั้นเปิด Serial Monitor ของ Arduino IDE โดยไปที่ Tools->Serial Monitor
11. เมื่อเปิด Serial Monitor จะได้ข้อความดังรูป


ขอบคุณ  www.ec,in,th/

0 ความคิดเห็น:

แสดงความคิดเห็น