# Example 12.1: Switch (bad connection)
# Ag Ins & IoT Class, Dept of Ag.Engineering, KMITL
# Ref: https://docs.micropython.org/en/latest/library/machine.Pin.html
#
# CONCERN:
#Floating signal on OFF position
from machine import Pin
from time import sleep_ms
sw = Pin(2,Pin.IN)
while True:
print(sw.value())
sleep_ms(1000)