I will try to make a simpler post than my last one. I am very new to programming, and just started with Arduino a few days ago. I have 10 momentary switches that send different voltages to the analog pin and are mapped to 10 LEDS on digital pins set as outputs. This is working fine.
What I want to do is emulate a rotary switch (NOT encoder). I other words, I press a momentary, it turns on its LED based on mapping the voltage to a digital pin, and the LED STAYS ON after releasing the momentary. If another momentary is pressed, the first LED turns off, the newly selected LED turns on, and stays on after the momentary is released, and so on and so forth. Only one LED can be on at a time.
I've been having a devil of a time trying to figure out how to do this, but I can't get it right. I have tried many different approaches. My 2 questions are:
- Is it possible to do this?
- Considering I really have put in the effort to learn how to do this, how do I do it? (please be kind).
I'm hoping I don't need to post code here. The operation is pretty standard, I started out mapping a potentiometer on analog input 0 to 0-1023, and was able to turn on each LED on digital pins 0-9, and simply substituted momentaries and voltage dividers to get the same results.
Thank you so much for listening.