I know in the docs it says you can't mix pins like A0 and B0 because they end in the same number, but it appears it goes for A2 / B12 as well. Is this right??
Assuming I want to use all my available pins for setWatch, does that limit me to 10 max?
I have a project where I am using 2 pins for I2c and then I need 9 pins watched for 3 rotary encoders with buttons. Is this doable on the pico or original espruino? if not, what are my multiplexing options? (i'm a beginner with muxing)
update - i just tried a2/a3/a4 while i also have i2c on b2 and it's working fine.. i also am watching B14 and it's not interfering with A4 .. so that's a bit confusing, but i guess good enough.
if there are conditions aside from 'same exact number on the pin', please let me know
What you may end up is to somehow use only one watch and then a read on all pins. Depending on your rotary endecoder, you may only need to watch the 'fastest'/'most' changing one to an the watch...
What kind of encoder are you using?
i'm not sure I understand what you mean, but for the time being, the issue is resolved. i just wanted to understand exactly what limitations there are on watches interfering.
the encoders i'm using: https://www.amazon.com/Cylewet-Encoder-15%C3%9716-5-Arduino-CYT1062/dp/B06XQTHDRR/ref=sr_1_4?ie=UTF8&qid=1522902358&sr=8-4&keywords=rotary+encoder
Ic. I had a different one in mind, where the readout is actually the position (degree, sector) and not just a pulses on rotation. The encoder incl. the button press requires - without trickery - indeed three (3) lines to watch.
The Pico/Original/WiFi boards have that restriction on the full number after the letter - so you should be able to theoretically have 16 watches (0..15) - although not all boards have all numbers exposed (eg. no pin 11 or 12 on the Pico).
Pin A2 and B12 shouldn't interfere, so I'm not sure what's going on there...
...just came across this hackaday post about encoders becoming i2c devices....
With that the bare bones are gone... (as much I like them...).
They are making normal encoders into I2C ones with a microcontroller. Unfortunately they're not selling all-in-one I2C encoders yet - although with 4 wires needed it's not making wiring easier ;)
OneWire would have been very cool though - and you could have chained them then.
... having said that I'm sure I've seen 2/3 axis magnetometers (which are already I2C) used as rotation encoders, possibly in a self-contained module.
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem