-
On behalf of a user who contacted me in private: I've been using the library for a few years in a project utilizing a Teensy 2.0. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The library is very well capable of handling 24 buttons on a single analog pin but, as you correctly stated, the voltage differences are going to be very small and that will be the tricky part. Memory consumption is not going to increase much, I went for a max 8 buttons default value for good measure (24 buttons, you must admit, is not the most common case): just add You might want to test something like the circuit simulated at this link which, using a network of stock resistors, will provide more than You can also use 3 separate instances, which will solve your issue of having a small interval, but you'll end up having to check three separate pins, which can introduce a totally different problem: when checking one line you will not be checking the other twos... A third approach might exist: multiplexing. You can still have My advice is to play with the simulations linked above to maximize the minimum interval and go for a single instance (either multiplexed or not) as it will be easier software wise. |
Beta Was this translation helpful? Give feedback.
The library is very well capable of handling 24 buttons on a single analog pin but, as you correctly stated, the voltage differences are going to be very small and that will be the tricky part. Memory consumption is not going to increase much, I went for a max 8 buttons default value for good measure (24 buttons, you must admit, is not the most common case): just add
#define ANALOGBUTTONS_MAX_SIZE 24
before including the library.You might want to test something like the circuit simulated at this link which, using a network of stock resistors, will provide more than
50mV
difference between each button: that's around10
points on the 12bits1024
scale of ADC provided by AVR microchips. In …