LED dimmer
OK this is very weird, I am hoping a fresh pair of eyes can see what I am not seeing. I borrowed this code from jonnymac used in thread for motor control animatronic head. I modified it with a potentiometer routine in main. When I turn the pot about half way I see about 3.1v if I keep turning it all the way to 10K it drops back down to 1.8v. Turning the pot all the way the other direction is as expected 0v. I am using a 0.1uf and 10K pot. I am unsure of why it is not going to 5v output at max pot setting. Why isn't it behaving as I expect it to?
Comments
Also don't enable the pull-up on RB.0 (the pot pin).
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"It is our choices, Harry, that show what we truly are, far more than our abilities."·Dumbledore from Harry Potter
www.iElectronicDesigns.com
·
Nick
Not knowing how things are wired makes things a bit difficult to analyze, but looking at your code, how do you ever get out of the loop in the following snippet copied from your DELAY routine?
·DO
··· \ CLRB isrFlag
··· \ JNB isrFlag, $
··· DEC msTix
·LOOP
Cheers,
Peter (pjv)
Post Edited (pjv) : 10/11/2008 6:51:21 PM GMT
I think I have to start from scratch since I always seem to spend more time figuring out code I didn't write.
Nick
Still textbook setup for the pot/cap. 0.1uf with 10K pot
code enclosed.
Nick