Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import RPi.GPIO as GPIO
- hall_sensor_pin = 24
- GPIO.setmode( GPIO.BCM )
- GPIO.setup( hall_sensor_pin, GPIO.IN, GPIO.PUD_UP)
- print "linker hall_sensor pin 24"
- def hallCallback(gpioNum):
- print("fallende Flanke auf GPIO %s"%gpioNum)
- GPIO.add_event_detect(hall_sensor_pin, GPIO.FALLING, callback=hallCallback, bouncetime=200)
- try:
- while True:
- print "Warte..."
- raw_input()
- except KeyboardInterrupt:
- print " bye bye "
- GPIO.cleanup()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement