import time
import RPi.GPIO as GPIO


REED_SWITCH = 21


def main():
    GPIO.setmode(GPIO.BCM)  # Use BCM GPIO numbers
    GPIO.setwarnings(True)
    GPIO.setup(REED_SWITCH, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
    
    val = None
    while True:
        new_val = GPIO.input(REED_SWITCH)
        if new_val is not val:
            val = new_val
            print(val)
        time.sleep(0.1)

    GPIO.cleanup()

if __name__ == '__main__':
    main()

bea63d3206379dc214254ac562d55ef76826565b
<mask token>


def main():
    GPIO.setmode(GPIO.BCM)
    GPIO.setwarnings(True)
    GPIO.setup(REED_SWITCH, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
    val = None
    while True:
        new_val = GPIO.input(REED_SWITCH)
        if new_val is not val:
            val = new_val
            print(val)
        time.sleep(0.1)
    GPIO.cleanup()


<mask token>

<mask token>


def main():
    GPIO.setmode(GPIO.BCM)
    GPIO.setwarnings(True)
    GPIO.setup(REED_SWITCH, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
    val = None
    while True:
        new_val = GPIO.input(REED_SWITCH)
        if new_val is not val:
            val = new_val
            print(val)
        time.sleep(0.1)
    GPIO.cleanup()


if __name__ == '__main__':
    main()

<mask token>
REED_SWITCH = 21


def main():
    GPIO.setmode(GPIO.BCM)
    GPIO.setwarnings(True)
    GPIO.setup(REED_SWITCH, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
    val = None
    while True:
        new_val = GPIO.input(REED_SWITCH)
        if new_val is not val:
            val = new_val
            print(val)
        time.sleep(0.1)
    GPIO.cleanup()


if __name__ == '__main__':
    main()

import time
import RPi.GPIO as GPIO
REED_SWITCH = 21


def main():
    GPIO.setmode(GPIO.BCM)
    GPIO.setwarnings(True)
    GPIO.setup(REED_SWITCH, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
    val = None
    while True:
        new_val = GPIO.input(REED_SWITCH)
        if new_val is not val:
            val = new_val
            print(val)
        time.sleep(0.1)
    GPIO.cleanup()


if __name__ == '__main__':
    main()

import time
import RPi.GPIO as GPIO


REED_SWITCH = 21


def main():
    GPIO.setmode(GPIO.BCM)  # Use BCM GPIO numbers
    GPIO.setwarnings(True)
    GPIO.setup(REED_SWITCH, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
    
    val = None
    while True:
        new_val = GPIO.input(REED_SWITCH)
        if new_val is not val:
            val = new_val
            print(val)
        time.sleep(0.1)

    GPIO.cleanup()

if __name__ == '__main__':
    main()
