I have a question. In this moment I am doing a test in Arduino, using this C++ QwstPad class. I encounter the problem that the sketch is able to connect to 2 qstpad boards. At class init for each of the pads the LEDs blink for a short moment as instructed in init(). The sketch reports that both pads are connected, however button presses of only the first pad (pad0), address 0x21, are “seen” by, for example, QwstPad::read_buttons(), however button presses on the second pad are not “seen”. I went over all the code for quite some time. Until now did not find the bug. I found some wrong definitions for QwstPad::getAddress() which returned uint16_t while it should be uint8_t. I corrected all these errors. I looked again at the class code of the Pimoroni qwstpad-micropython repo, however did not (yet) discove differences. When I run the Pimoroni micropython example pad_detect.py in Thonny, both pads are recognized. The device I ran the pad_detect.py example on is a Pimoroni Pico Lipo 2XL W (RP2350) while the C++ Arduino test I run on an Adafruit Feather ESP32-S3 TFT.
Problem discovered. Beside two Pimoroni QwstPad game controllers I had two other I2C devices connected to the same Qw/ST connector of an Adafruit Feather ESP32-S3 TFT board. When I have only the Nr 2 QwstPad (0x23) connected, the sketch (and the functions of the ported C++ QwstPad class “see” the button presses. I am going to proceed with testing the ways of connecting the four I2C devices to the one Qw/ST connector on the Feather.
Problem solved. I connected the four external I2C devices to two I2C buses. The two Pimoroni QwstPad’s I connected to a second I2C bus “Wire1” (SDA1 pin GPIO10, SCL1 pin GPIO11). The other two external I2C devices I kept connected to the first I2C bus “Wire”. Now all four external I2C devices are working as intended.