Skip to main content

Ardunio UNO. Coding on Incrementing and Decrementing an output voltage by using two buttons

Hello I was wondering if anyone can please help Me. I'm trying to create a code using an Ardunio UNO board to increment and decrement the output voltage of the Ardunio Uno which is 5 volts and I need to step it up to 10 volts which I have done below. The things that are missing on the schematic are Two buttons. I want to be able to increment 0.5 volts with each press of Button-A until the ardunio is at 5 volts. With Button-B I want to be able to lower the voltage by 0.5 volts with each press of the button till value is 0. I can do the calculations and the circuit design but I'm not much of a programmer. I just want to know if anyone can point me in a good direction of where I can get the right code. I have already looked at all the tutorials on the Arduino Website. I do know I have to work with the PWM functions as well as attachinterrupt() and Debounce() functions. Also, how do I set the increments so that I don't go over, say it takes 10 presses to get to 5 volts on the 11th press have it not do anything so I don't break anything. So can anyone please help me with any suggestions. Thank you.

I have a low pass filter on the circuit for noise handling and like I said I need to add in the buttons to my schematic.

schematic

simulate this circuit – Schematic created using CircuitLab