This is the simplest form of input with only two possible states: on or off. This example reads a simple switch or push button connected to pin2. When the switch is closed the input pin will read HIGH and turn on an LED
นี่คือรูปแบบที่ง่ายที่สุดของการป้อนข้อมูลที่มีเพียงสองรัฐเป็นไปได้: เปิดหรือปิด ตัวอย่างนี้อ่านง่ายหรือสวิทช์ปุ่มกดเชื่อมต่อกับ PIN2 เมื่อสวิทช์ปิดขาอินพุตจะอ่าน HIGH และเปิดไฟ LED