#Arduino Nano buttons Limit
1 messages ยท Page 1 of 1 (latest)
And what pins are you planning to use for them?
D3 and D2
If you have 18 buttons, that should already have taken up all pins...
No, some button need 1 pin (ON-ON) and some button need 2 pin (ON OFF ON)
12 digital pins (D2-D13) and 6 analog pins that can be used for digital I/O (A0-A5)
Im using analog pin for my switches
A6/A7 only work with potentiometer inputs
that's a limitation of the Arduino Nano, nothing we can do about it
Maybe a multiplexer ?
multiplexer should work. Shift register too
I watched a lot of tutorials and I don't understand how I have to wire it, I have a 16 multiplexer. I have three cables, they have to become 1 cable. Is it possible ?
you need four digital pins as address lines as well, so it is more like turning seven lines into 5
so how can I wire it ?
๐ Check out this wiki page for information on using multiplexers with MobiFlight:
Beginner's guide to input multiplexers
thanks
๐ Check out this wiki page for information on using input shifters with MobiFlight:
Adding lots of buttons with an input shift register
@fickle osprey what commands you want to use fo ON-On switches?
What you want to do with those switches?
aaahok, nevermind, I misread on the phone one of your previous messages
No problem
Just a thought,... You could use A6 and A7 for switches by fooling them into thinking that they're conncted to potentiometers.
Your switch is probably an SPDT center off type, right?
So here we tie A6 high with a pullup resistor. When the switch is in that center off position, the Nano sees a potentiometer that's putting out 5 volts, so it returns an input value of 1023.
When you flip the switch to the up position, A6 is now connected to both the pullup resistor and to ground through R2. The Nano now sees a potentiometer that's sitting in it's middle position and returns a value around 512.
When you flip the switch the other way, A6 is now connected to ground through the switch. (don't worry, our good friend R1 will keep this from being a dead short) What the Nano sees is a potentiometer turned all the way down and returns a value of 0.
In the MobiFlight configuration, you'll need to do a little coding to tell the sim what you want it to do when the value equals each of those conditions, but you've just fooled it into accepting a couple of switch inputs on those pesky analog input only pins...
Sure, that should work. I think a two position switch would only require one resistor. You could wire a rotary switch with a resistor ladder too.