- ฝึกการใช้ input arduino
- arduino
- switch
- ลง Arduino IDE
- เลือก file > example > digital > digitalinputpullup
- ต่อสาย input ที่ D2
- output จะอยู่ที่ LED 13
เมื่อกดปุ่ม ไฟ จะติด
ปล่อยไฟจะดับ


แบบฝึก
ลองใช้ LED 7ดวง กดปุ่มแล้วไฟ 7ดวงกะพริบ ปล่อยแล้วไฟLED ติด 1ดวง วิ่ง ซ้ายไปขวา
ไม่มีความคิดเห็น:
แสดงความคิดเห็น