Multiple toggle switches on one GPIO


#21

I suspect that comes from an open input.

Your readings match for a 7-position switch and corresponding 6-resistor string, but you seem to have an 8-or-more position switch? A capacitor is not the right solution here, you need to correct your resistor/switch circuit.


#22

ahhh okk, yeah im total noob but very well willing to learn ,but yeah i have a 8 position switch. so i have to add one more resistor on the next terminal i guess.


#23

I fixed everything, all the other switches are working perfectly:) only the switch with 8 steps switch step 4. In the GPIO in from the help file, he shows perfect 8 steps. in my patch he skips step 4 and the last step he dont do anything.i tried a lot and other gpio's ,other switches etc. any ideas what it could be?

DIAL MATRIX SYNTH all connected testing.axp (105.1 KB)


#24

Sorry, correction...: adjust the "math/*c" parameter to the number of steps of your switch minus 1. So 8 position switch -> "math/*c" with value 7.


#25

like a sunshine now! thanks a lot!some little adjustments and fixing some other problems and he is ready for production:)


#26

Hi!
I find this very interesting :slight_smile:
Sorry to bring this topic back, but I have a question:
What should the value of the resistors be? Or would it depend on the number of steps you want to use?


#27

Keep the resistor values the same as described, doesn't mater how many steps you have or even if you add extra steps later, just keep the resister value the same.
I had this setup with 20 momentary switches and all worked fine.
2 things to note if you are using momentary / toggle switches that are all connected to one analogue input..
1 - You can only press one switch at a time.
2 - There will be tiny fractional delay as the signal rises to its analogue value.
:grin:


#28

Great, thanks a lot, that's what I needed to know! :slight_smile: