My goal: I am making a simple remote controller with a XBee3, an LCD screen and 6 push buttons.
The idea is to use the i2c to communicate with the LCD screen and 6 DIO to check on the buttons.
The good part: I successfully used the i2c protocol in a micropython program.
the bad part: Out of all 6 DIOs I used, three of them work all the time. The three others only ever work if the xbee-usb-adapter board is plug to a computer and if the XBee REPL python console is connected.
All push button have an 10k pulldown resistor on the input pin. I also set the pulldown in the AT interface, and in the micropython code like this:
start_pin = Pin("D12", mode=Pin.IN, pull=Pin.PULL_DOWN)
stop_pin = Pin("D10", mode=Pin.IN, pull=Pin.PULL_DOWN)
top_pin = Pin("D3", mode=Pin.IN, pull=Pin.PULL_DOWN)
bot_pin = Pin("D6", mode=Pin.IN, pull=Pin.PULL_DOWN)
left_pin = Pin("D2", mode=Pin.IN, pull=Pin.PULL_DOWN)
right_pin = Pin("D5", mode=Pin.IN, pull=Pin.PULL_DOWN)
Only D12, D10 and D3 are working as intended.
D6, D2 and D5, only work while the XBee REPL micropython console is working.
PR = 0xFFFF
PD = 0xF399
Right now to try to find the problem, i disabled the i2c part of the program and pins.
Nothing has changed.
I will try other pins as well, but I would like to make these ones work nonetheless.
Anyone has a good solution for me?
Thank you in advance.