Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5359

MicroPython • Re: multithreading with Raspberry Pi Pico for model railroad

$
0
0
Okay. Here we are in a new thread talking about trains. Is the person asking the train question still here?
We may have lost them, but they visit back every few months.

I think we might need a bunch more information for the setup, but for the “8 inputs from Hall effect devices sensing magnets under trains” bit, maybe a I/O expander like the MCP23008 or PCF8574? While these reduce the pin count, they can also be set up to generate an interrupt whenever the state of any of the inputs changes. This is preferable to polling every input in turn.

Awesome MicroPython shows several libraries that support these devices. Mike Causer's micropython-pcf8574: MicroPython driver for PCF8574 8-Bit I2C I/O Expander with Interrupt looks like it might work, and is fairly recently maintained. Not many PCF8574 boards expose the INT pin clearly, though.

Statistics: Posted by scruss — Sun Aug 04, 2024 5:07 pm



Viewing all articles
Browse latest Browse all 5359

Trending Articles