Hi, I am using a XIAO RP2040 with Thonny and MicroPython.
Everthing works fine, but no Digital Input. I tested it with 4 different XIAO RP2040 on different Ports and allmost the same…
Digital Output works fine. But Digital Input always stays on the value of the internal Pull-Restors (High or Low doesnt matter)…
Here some Code:
from machine import Pin, Timer, ADC import os os.chdir("/") LED_white1 = Pin(26,Pin.OUT) LED_lila = Pin(27,Pin.OUT) LED_red = Pin(28,Pin.OUT) LED_white2 = Pin(29,Pin.OUT) LED_green = Pin(6,Pin.OUT) LED_blue = Pin(7,Pin.OUT) Button_0 = machine.Pin(0, machine.Pin.IN, machine.Pin.PULL_UP) try: f = open('state.log') Routine = f.read() except: Routine = 3 #This Code isn't complete, it is shortened for the Forum-Request... while True: print (Button_0.value())
The wiring is working fine, all LEDs could be enlighted as i wanted by different subroutines. But reading the value of Button is allways 1…
Mesurement on the Input Pin itself is preety good, changed from 3V3 to 0V by pressing the button, but in the software Button_0.value() is read as 1 … also on other Hardware Ports on different RP2040.
Also tried as Analog Input on an Analog Input Port, also no change . Seems that there is no reading at all.
I didn’t found any solution for my problem
Same Programm on Teensy2.0 and PaspberryPico works fine, only on XIAO RP2040 not.