Become a leader in the IoT community!
Join our community of embedded and IoT practitioners to contribute experience, learn new skills and collaborate with other developers with complementary skillsets.
Join our community of embedded and IoT practitioners to contribute experience, learn new skills and collaborate with other developers with complementary skillsets.
Came up with some code for a project I’m working on that is able to read two buttons for each analog input (and tell if two have been pushed) based on this circuit. It works, but is not really optimized resistors-wise. I’ve yet to figure out a generalized expression for this type of parallel circuit (thinking one in which I could make it 3, 4, whatever resistors/buttons), which admittedly would be a matter of elegantly combining some algebraic equations.
Any thoughts?
Here’s the rest of my code, FWIW https://github.com/JeremySCook/arduino-experiments/tree/main/MIDI/1-inch-MIDI
BTW, what is the best way to post a bunch of code here? I think there is something with using ` but seems I always get it wrong.
Why are you using analog signal to read a digital input, you could use ” INPUTPULLUP” or “pulldown” functions and read values only where it’s near 0/1 this makes a lot better preformence
Because I am reading two buttons on each pin. I am using an ATtiny85 and my IO is very limited.
CONTRIBUTE TO THIS THREAD