This is more of a general is this possible question before I get hip deep in programming.
I have some momentary LED buttons. Im assuming that for this type of button I can treat the LED and the button as two separate things. I seem to remember that one can use a momentary switch as, essentially, a latching switch with programming. I also seem to remember that a button can be used to call a function.
This is what I’d like to do and checking to see if it’s even possible. The robot I’m building will have a couple of different modes or functions. Right now I can change the modes with an IR remote. I want to be able to put it in one mode with the remote then stop that mode with a button then use another button to put it in a different mode.
I’d also like to have the LED in the buttons come on depending on what mode it’s in if either the button is pressed or the ir remote is used. I’m thinking this is 3 separate things. One is turning on and off an LED depending on what mode it’s in. Another is turning the mode on and off with the remote and finally turning the mode on and off with the momentary switch.
After reading all this is this possible and am I thinking about it in the correct way?
I have an ardurino uno r3 with a sensor shield that I got as part of a car kit. I also have a L298n to drive the wheels. I’ve been using the kit to test what I want to do before I cram it all in the robot I’m printing, a K9 from Doctor Who. I have the IR drive control, obstacle avoidance, and the follow modes all working
Also, to sneak another question in. I’d like to add audio but I’m wondering if I should get a separate Arduino to run just the audio. Can I use one ardurino board to cause the other board to play the audio?
Adding a second Arduino to a project often creates more problems than it solves. Do you have any pins of any kind left on the Uno with all of the current functionality in use ?
Assuming I can use all 12 of the pins on the sensor shield then yes, I have enough. I have 6 possible buttons but at least 2 of them will be used for non Arduino things. One will be a switch for the battery pack one will probably be for some always on lighting effects.