Why is this code not working(pwm on a 16f628a)


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default Re: Why is this code not working(pwm on a 16f628a)

    Quote Originally Posted by gadelhas View Post
    Try this code insted

    Code:
    STARTMAIN:
    if button=0 then   
     For Duty=0 to 255       
      PWM LED4,Duty,Cycle   
     Next   
     high led4    
     pause 1000 
       
     For Duty=255 to 0 Step -1       
      PWM LED4,Duty,Cycle    
     Next
    endif
    
    low led4
    GOTO STARTMAIN
    If you read the PBP Manual you will see that the PWM command after execution turn the pin input.
    thanks, so high and low still work when the pin is a input, interesting.

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


    Did you find this post helpful? Yes | No

    Default Re: Why is this code not working(pwm on a 16f628a)

    not interesting, it is explained in the manual...
    Steve

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

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