Micropython M5Stamp Stamp I/O Help please?
ajb2k3 last edited by ajb2k3
And another Micropython I2C help request.
Is anyone using the Stamp IO expansion stamp?
I'm having problems understanding how to control it and its not in UIFlow yet!
felmue last edited by felmue
on the document page the Stamp I/O Arduino examples point to the ExtIO2 unit examples.
So, I'd try the UIFlow blocks for the ExtIO2 unit.
teastain last edited by teastain
Adam, I nearly went mad getting this to work! Part of the problem was wrapping my brain around how it worked. It is a silly invention of little use, I say!
I found a weakness in the library that prevented individual pin functions, like pin 1 input, pin 2 RGB, pin 3 output.
Our friend felix edited the library header and did a pull request and now they are all individually selectable. This image is actually a short video, but I don't think I can upload it here. Imagine if you will, the LED blink-ing...
However the examples were NOT updated and they still say "AllPinMode", so this is confusing.
I realize this is C, but it might be illustrative for translation to UIflow?
@teastain @felmue I've read, reread and experimented in micropython and still get a problem trying to control it.
Mind you I have a cold so my brain isn't at its best but every time I trying to i2c.write() it causes a Error19: ENOMEM meaning I'm doing something wrong.
Something about access the registers is not working for me.
I think I may have broke it!
I found a clue to programming it. It is the EXTI/O2 Unit in a miniaturised form. Same hardware, firmware and address.
Way hay I got it.
in micropython you use
i2c.writeto_mem(0x45, 0x00, b'\x01')
to set the mode and then
i2c.writeto_mem(0x45, 0x10, b'\x01') i2c.writeto_mem(0x45, 0x10, b'\x00')
to turn each pin off and on it digital mode.
And I can conform that the EXT I/O 2 and the ExtI/O stamp are the same units!