I need to make a digital switch with arduino uno. My senario is as followes, I a 4.5v power supply comming from the ECM of my truck I currently have a 5 possition rotary switch as my switch for changing my voltages right now. This is my idea. I have five resistors 2.2k, 5.6k, 270 ohm, 1k, 27k wired like this to my arduino
see the picture below.
I want the power source coming from my truck to be regulated via digital switch by my arduino. When I push the up button I want the aduino to divert the voltage coming from my truck through the one resistor at a time for every time I push the up button. Then cycle down through the resistors one at a time per times i push the down button. my question is… did I wire it correctly to do so and will the code for this be difficult to write??