#Arduino Nano buttons Limit

1 messages ยท Page 1 of 1 (latest)

fickle osprey
#

What ?? I just need to add 2 more buttons... There is a solution please ?

livid basalt
#

And what pins are you planning to use for them?

fickle osprey
#

D3 and D2

livid basalt
#

If you have 18 buttons, that should already have taken up all pins...

fickle osprey
#

No, some button need 1 pin (ON-ON) and some button need 2 pin (ON OFF ON)

livid basalt
#

12 digital pins (D2-D13) and 6 analog pins that can be used for digital I/O (A0-A5)

fickle osprey
#

Im using analog pin for my switches

livid basalt
#

A6/A7 only work with potentiometer inputs

#

that's a limitation of the Arduino Nano, nothing we can do about it

fickle osprey
#

Maybe a multiplexer ?

livid basalt
#

multiplexer should work. Shift register too

fickle osprey
#

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 ?

livid basalt
#

you need four digital pins as address lines as well, so it is more like turning seven lines into 5

fickle osprey
#

so how can I wire it ?

restive acornBOT
fickle osprey
#

thanks

restive acornBOT
dreamy herald
#

@fickle osprey what commands you want to use fo ON-On switches?

fickle osprey
#

? I don't understand

#

commands ?

dreamy herald
#

What you want to do with those switches?

fickle osprey
#

light panel

dreamy herald
#

aaahok, nevermind, I misread on the phone one of your previous messages

fickle osprey
#

No problem

amber oyster
#

Just a thought,... You could use A6 and A7 for switches by fooling them into thinking that they're conncted to potentiometers.

amber oyster
#

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...

south latch