Newbie help. RGB Led on a PIC10F202


Closed Thread
Results 1 to 40 of 42

Hybrid View

  1. #1
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: Newbie help. RGB Led on a PIC10F202

    Steve, wonderful examples, I think th OP may have a few questions for you, especially in the last with port indexing. But why doesn't his work after he moved the IF into the switchloop section? BTW, he will still have problems with button press being 1 for a zillion loop iterations, don't ya think?

    @Brian, if you press the switch repeatedly, will that make the other LED's light? If so, does it seem to be random as to which will light?
    -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!

  2. #2
    Join Date
    Aug 2011
    Posts
    16


    Did you find this post helpful? Yes | No

    Default Re: Newbie help. RGB Led on a PIC10F202

    Quote Originally Posted by cncmachineguy View Post
    Steve, wonderful examples, I think th OP may have a few questions for you, especially in the last with port indexing. But why doesn't his work after he moved the IF into the switchloop section? BTW, he will still have problems with button press being 1 for a zillion loop iterations, don't ya think?

    @Brian, if you press the switch repeatedly, will that make the other LED's light? If so, does it seem to be random as to which will light?
    Many thanks Steve for those examples. I tried both of your last ones just above this post and neither seem to be working. It does not light upon circuit power nor if i press the button to cycle through the other colors.

  3. #3
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: Newbie help. RGB Led on a PIC10F202

    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:
    Code:
    main:
    gosub red
    gosub blue
    gosub green
    goto main
    I know you said in your first post that all three worked, lets just be sure, then we can build on that .
    -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!

  4. #4
    Join Date
    Aug 2011
    Posts
    16


    Did you find this post helpful? Yes | No

    Default Re: Newbie help. RGB Led on a PIC10F202

    Quote Originally Posted by cncmachineguy View Post
    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:
    Code:
    main:
    gosub red
    gosub blue
    gosub green
    goto main
    I know you said in your first post that all three worked, lets just be sure, then we can build on that .
    Works perfectly. Didnt work at first, but then i forgot the OPTION_REG.5 = 0 had to be put into the code for GPIO.2 to work.

  5. #5
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: Newbie help. RGB Led on a PIC10F202

    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!

  6. #6
    Join Date
    Aug 2011
    Posts
    16


    Did you find this post helpful? Yes | No

    Default Re: Newbie help. RGB Led on a PIC10F202

    No just the code that you asked me to try.

  7. #7
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: Newbie help. RGB Led on a PIC10F202

    Now let's make sure that button is working. Modify the main to be this:
    Code:
    main:
    Gosub red
    If button =1 then goto skipgreen
    Gosub green
    Skipgreen:
    Gosub blue
    Goto main
    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)
    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!

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts