Quote Originally Posted by Tastature View Post
Hey
I need this code:
You'd get a lot more help by writing some code and asking other people to help you figure out why it doesn't work VS. asking others to write code for you.

How to change 5 V on some . Sample when portb.0=1 (program).... program is like pot, it relaxation 5 volt, on 4.9 then 4.8..4.7...0. How can i do that? My english is bad i forget some things, sorry
A dozen different ways to do this...
One way, yes, connect an external digital pot (I've used the Xicor types), and control it.
Another way, use the PWM module (or software PWM) across an R/C network, vary the duty cycle of the PWM output to change the average voltage across the cap. Probably want to follow the R/C with an Op-Amp so any loads won't change the voltage across the cap much.