Extra switches now customizable from webconf

Oh!.. Is it a temporary issue or all the guides about wiring buttons to the RPi just automatically expect that you do not use any MCP at all? Why is there talk about “extra” switches, then - “extra” to what?

Well, I have not studied the code, so I do not know whether you use some python library or just bash scripts, but that should not be a big problem, is it? When seeing the numbers above 100, I just expected a system similar to the IoAbstraction library for Arduinos - but OK, this is a completely different platform, so I should not be surprised and let me confuse by the similar system of PIN numbering.

I see now - the zyncoder module is written in C using the wiringPi library. I will try to have a look at the code, why is it a problem to deal with both an MCP and native GPIO at the same time… I already noticed that multiple MCPs are not supported either (yet?).

I just wanted to note a possible alternative to the port expander is the MPR121 I2C Capacitive touch 12 input chip, with some pins that can also be programmed as GPIO connections (with tricky looking code) , it could do the encoder interface as well as handling a row of panel buttons.
MPR121 Capacitive Touch and GPIO
1 board delivered for $2.33 (4 for $4.60)
These boards might be handy for a controller project, you can have 48 inputs using the 4 different I2C addresses available. Adafruit Writeup . . . Sparkfun

If it did prove reliable handling rotary encoders, you could have web interface selectable touch switch or digital input options on the remaining pins

It could be a good replacement on future hardware versions.

Thanks!

1 Like

It’s not a “real problem”. It could be done, but current code doesn’t allow it because until now nobody tried this combination. That’s all :wink:

Currently you can use these configurations:

  • 1 or 2 x MCP23017 (interrupts)
  • RBPi GPIO for switches & encoders (interrupts) + MCP23008 for switches (polling)

I must apologize because the zyncoder.c code is a mess. It was one of the first pieces of zynthian and it needs a deep refactorization, but as it works quite well and it’s highly critical, i’ve no incentive for prioritizing the task. Mr @riban is pushing to me for doing the task, so perhaps you could joint your forces and increase the pushing … or do the task!!! :rofl:

Regards,

2 Likes

@wyleu would like to add to the push…

2 Likes

@dhrupadiya backs up @riban and @wyleu.

Can’t help with the code itself (not qualified enough), sorry about that !

oh yes plaese, they are some free gpio’s who are waiting to be wired on custom switches :wink: