Antorbd,

to add a variable to your code you simply declair it at the beginning like this...

AdjustPWM VAR BYTE


Then you can read the AD converter connected to your variable resistor like this...

ADCIN 5, AdjustPWM

then you can use the value you read in to your variable "AdjustPWM" in your PWM adjust command, something like the...

HPWM 1, AdjustPWM, 500


--------------------------------------

are you using PicBasic ?? or some other basic language??

If PicBasic do you have the manual?

----------------------------------

for a beginner it is extremely helpful to read and study other working code examples.
Use the search function at the top of the forum and enter a couple of search terms and you will find lots of examples.

Also go to the WIKI section at the top also and look at the projects there.

Good luck and keep asking questions.