Ok, new test for you to try. First make sure all three PWM's are working.Let you main call them 1 at a time like this:
I know you said in your first post that all three worked, lets just be sure, then we can build on that .Code:main: gosub red gosub blue gosub green goto main
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
Does the whole thing work, button and everything?
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
No just the code that you asked me to try.
Now let's make sure that button is working. Modify the main to be this:
That should have all three lit as before unless you press the button, then it should skip the green gosub. Btw, is the tris for the button set to input? Also I am a lazy typer, so I assume you will make the names be what they need to be like button shoud really be switchpin (i think)Code:main: Gosub red If button =1 then goto skipgreen Gosub green Skipgreen: Gosub blue Goto main
Last edited by cncmachineguy; - 14th August 2011 at 03:52.
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
Im not sure how to set tris on GPIO.3 I assumed because the datasheet says its an input only pin, i didnt have to futz with it. When i run your code above, i get Red, Green, Back to Red. If i tap the switch, the whole circuit turns off and stays off while i hold it. I never see blue.
Bookmarks