User control/input/switches/etc.

General discussion about topics related to OpenMV.
User avatar
kwiley
Posts: 88
Joined: Fri Dec 21, 2018 5:22 pm

User control/input/switches/etc.

Postby kwiley » Wed Jan 16, 2019 5:00 pm

I'm not sure if this belongs in the technical forum, but at any rate, what is the best way to get a little bit of user control over the board? I would like to be able to influence the board's behavior a bit. The simplest example would be a "camera shutter button" that captures a photo at the current moment to the SD card. But that's an absolutely minimal example (a single binary input). I'm asking more generally. I think minimal pushbutton switches could be applied to the I/O lines (can any line be configured this way?), but that isn't much input (one binary input per line, and there aren't many lines). Plus, with the LCD shield in place, three of those lines are taken up for "LCD Reset", "SPI Command", and "Backlight Control". So that leaves P9 (the third servo line) and P4 and P5 (the I2C/UART lines). That's it, correct? (presumably MISO couldn't be used, even though the LCD doesn't use it, since the entire SPI interface probably takes over all four SPI lines).

I'm just curious what other people have done toward similar goals. Are people attaching serial UART or I2C based input devices to the M7? How has that worked out? I'd love to hear about other people's user control and input solutions with OpenMV.

Thanks.
User avatar
kwagyeman
Posts: 2895
Joined: Sun May 24, 2015 2:10 pm

Re: User control/input/switches/etc.

Postby kwagyeman » Wed Jan 16, 2019 11:16 pm

Mmm, if just buy an I2C I/O expander:

https://www.sparkfun.com/products/13601

Just use the machine I2C module to talk to it. There are might already be a driver if you Google MicroPython I2C expander.
Nyamekye,
User avatar
kwagyeman
Posts: 2895
Joined: Sun May 24, 2015 2:10 pm

Re: User control/input/switches/etc.

Postby kwagyeman » Wed Jan 16, 2019 11:17 pm

Done: https://github.com/ShrimpingIt/micropython-mcp230xx

Note that this driver is for a different board than above.
Nyamekye,
User avatar
kwiley
Posts: 88
Joined: Fri Dec 21, 2018 5:22 pm

Re: User control/input/switches/etc.

Postby kwiley » Thu Jan 17, 2019 3:33 am

Cool. There's so much stuff out there and I'm not much of an electronics tinkerer, so I'm generally unaware of all these options.

Thanks.

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 3 guests