Newbie help. RGB Led on a PIC10F202


Results 1 to 40 of 42

Threaded View

  1. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: Newbie help. RGB Led on a PIC10F202

    Code:
            Red         var GPIO.0
            Green       var GPIO.1
            Blue        var GPIO.2
            SwitchPin   var GPIO.3
            
            ButtonCount VAR BYTE
            ButtonCount = 0
            
            ;Make sure LEDs are off
            HIGH Red
            HIGH Green
            HIGH Blue
    
    MAIN:
            IF SwitchPin = 1 THEN
                    If ButtonCount<3 THEN
                            PWM GPIO.0(ButtonCount),127,100
                            ButtonCount = ButtonCount + 1
                        ELSE
                            ButtonCount = 0
                        ENDIF
                    endif
            GOTO MAIN
    Last edited by mister_e; - 14th August 2011 at 03:05.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Members who have read this thread : 1

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