Using a PaHUB with NeoPixel, is it possible, how do a find/set the address of the unit when accessing via the PaHUB?
-
Hi. I am trying to connect and access a UHF RFID reader and NeoPixel RGB strip connected to a PaHUB and then to a Core2. Firstly, I note that for these two units, PaHUB is not an option in the Port selector (so perhaps they're not compatible)? If this should work then how should I code this MicroPython; I have done the following having connected to the NeoPixel on Pin 0:
pahub_1 = unit.get(unit.PAHUB, unit.PORTA)
neopixel_1 = unit.get(unit.NEOPIXEL, unit.PAHUB0, 10)However, any attempt to use the neopixel e.g.
while True:
neopixel_1.setColorFrom(1, 5, 0x183737)have failed? Any advice would be much appreciated as I'm a complete Novice.
Regards,
Tom
-
Hello @Tomarno
PaHUB is an I2C extender allowing multiple I2C devices (using the same I2C address) on the M5Core2 I2C port A.
Unfortunately neither of the two units you are trying to connect are I2C devices.
UHF RFID reader unit is an UART device and NeoPixel requires dedicated GPIOs as the timing needs to be quite accurate.
From UIFlow I understand that you could connect NeoPixel to port B and UHF RFID reader to port C. But you'll need an M5Go2 battery bottom to get port B and port C.
If you want to try out either of the two units, they can be connected to port A, but only one at that time.
Thanks
Felix -
@felmue Thank you so much, you've saved me hours of trawling.