This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void setup() { | |
| Serial.begin(9600); | |
| /*ฟังก์ชั่น Serial.begin(9600); เป็นการเรียกใช้งาน Serial Communication ผ่านการเชื่อมต่อ Serial Port (ในที่นี้ Arduino จะใช้การเชื่อมต่อผ่าน USB โดยมี USB to Serial ภายใน) ด้วยความเร็วที่เชื่อมต่อคือ 9600 หรือเรียกว่าบรอทเรต 9600*/ | |
| } | |
| void loop() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int pushButton = 2; | |
| /*เป็นการประกาศตัวแปรชนิด int (เก็บจำนวนเต็ม) ชื่อว่า pushButton โดยมีค่าเท่ากับ 2 เพื่อเก็บค่านี้ไว้ใช้ต่อในส่วนต่อไปของโปรแกรม*/ | |
| void setup() { | |
| Serial.begin(9600); | |
| /*ฟังก์ชั่น Serial.begin(9600); เป็นการเรียกใช้งาน Serial Communication ผ่านการเชื่อมต่อ Serial Port (ในที่นี้ Arduino จะใช้การเชื่อมต่อผ่าน USB โดยมี USB to Serial ภายใน) ด้วยความเร็วที่เชื่อมต่อคือ 9600 หรือเรียกว่าบรอทเรต 9600*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void setup() { | |
| pinMode(13, OUTPUT); | |
| /*ฟังก์ชั่น pinMode(13,OUTPUT); คือการกำหนดโหมดของการทำงานของขานั้นๆ เช่นคำสั่งนี้จะทำให้ขา 13 มีสถานะคือการ output นั้นคือสามารถกำหนดให้มีไฟออกจากไมโครคอนโทรเลอร์ได้ว่าจะให้ออก 0V หรือ 5V ตาม logic ที่เรากำหนดในโปรแกรม หรือพูดให้เข้าใจง่ายๆ คือ สั่งหรือติดหรือดับนั้นเอง*/ | |
| } | |
| void loop() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int led = 9; // ประกาศ pin สำหรับการใช้ PWM | |
| int brightness = 0; // ตัวแปรปรับความสว่าง (0-255) | |
| void setup() { | |
| pinMode(led, OUTPUT); //กำหนดให้ pin led เป็นขาส่งสัญญาณออก | |
| } | |
| void loop() { | |
| analogWrite(led, brightness); //คำสั่งให้ led แสดงผล | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Requirement NODEJS | |
| - facebook-chat-api | |
| - microgear | |
| */ | |
| /* ### START CONFIG ### */ | |
| var facebookEmail = 'email'; | |
| var facebookPassword = 'pass'; | |
| //NETPIe |
NewerOlder