Created
March 6, 2019 14:57
-
-
Save myarduinosale/f0bdd0300c7ccdbf1191137d86cebe1b to your computer and use it in GitHub Desktop.
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 led1 = 3; // กำหนดขาใช้งาน | |
int val = 1; | |
void setup() | |
{ | |
pinMode(led1, OUTPUT); // กำหนดขาทำหน้าที่ให้ขา 3 เป็น OUTPUT | |
Serial.begin(9600); | |
Serial.println("My arduino"); | |
} | |
void loop() | |
{ | |
digitalWrite(led1, HIGH); // ไฟ LED 1 ติด | |
Serial.print(val); // Arduino ส่งค่าในตัว แปล val ให้ arduino | |
Serial.print("ON "); // Arduino ส่งคำว่า "ON " | |
Serial.println("LED"); // Arduino ส่งคำว่า "LED" | |
delay(2000); // ดีเลย์ 2000 มิลลิวินาที | |
digitalWrite(led1, LOW); // ไฟ LED 1 ดับ | |
Serial.print("OFF "); // Arduino ส่งคำว่า "OFF " | |
Serial.println("LED"); // Arduino ส่งคำว่า "LED" | |
delay(2000); // ดีเลย์ 2000 มิลลิวินาที | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment