dim a led


Closed Thread
Results 1 to 4 of 4

Thread: dim a led

  1. #1
    Join Date
    Jan 2006
    Posts
    8

    Default dim a led

    hello, I would like dim 2 leds with a 16f628 and I wanted to know which function to use but if I use the function pwm the program is very slow


    regards
    fred

  2. #2
    Join Date
    Oct 2003
    Location
    holland
    Posts
    251


    Did you find this post helpful? Yes | No

    Default

    Then you may try the Hpwm function (only one) or write your own pwm that is faster then.

  3. #3
    Join Date
    Jan 2006
    Posts
    8


    Did you find this post helpful? Yes | No

    Default

    thanks

    how one can create his pwm?


    fred

  4. #4
    Join Date
    Oct 2003
    Location
    holland
    Posts
    251


    Did you find this post helpful? Yes | No

    Default

    Code:
    pwmxl:
               if cntr = 0 then outputport = 1        'this clears all pwm ports
               if cntr = dutycl then outputport = 0  'this line can be repeated for as                                                                                                                          
                                                                 'many as you have pwm outputs
               cntr = cntr + 1
               if cntr = 0 then exitpwm
               goto pwmxl
    exitpwm:
               return
    I hope the rest you figger out by yourselfs !

Similar Threads

  1. new and need help
    By smeghead in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 3rd November 2008, 20:19
  2. For next loop using: Led var Byte
    By quester in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th March 2008, 10:16
  3. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30
  4. Interrupts interfering with PRINT
    By lsteele in forum General
    Replies: 7
    Last Post: - 21st September 2006, 20:44
  5. can't even flash an LED
    By bruno333 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 28th April 2005, 13:27

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