Yes thanks, I had just figured it out. :) :+1:
Posts made by John Robinson
RE: Problems setting up python to read input from magnetic door sensor.
Problems setting up python to read input from magnetic door sensor.
I am having issues with my python code converting it from raspsberry pi to onion.
Here is the python from the raspberry pi:
door_pin = 26
GPIO.setup(door_pin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
and here is the onion code:
pin = 14
door_pin = onionGpio.OnionGpio(pin)
status = door_pin.setINputDirection()
value = door_pin.getValue()
But no matter what I do I cannot get the value to read anything but 0 from the GPIO14. My magnetic sensor is a simple 2 wire setup. With one wire on the gpio and the other on gnd. Just like I have setup on mt Raspberry Pi. But I cannot seem to get it to work on the onion.