adjustment stops


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2006
    Posts
    76

    Default adjustment stops

    I am using the hardware pwm on the 16f767 to control some LEDs. The control values are from 0-255, but when you reach each limit, you can roll over and start again. how do i put stops on the high and low limits to prevent rollover?


    I mainly want to do this because these LEDs are insanely bright and take about an amp a piece. If someone was to take the level down while looking at it and rolled past 0 to 255, it could spell bad news.

    thanks
    -brian

    ps. I am using all 3 hardware pwms so all settings are configured manually.

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


    Did you find this post helpful? Yes | No

    Default

    Code:
    If IncrementButton=1 then
        If PWMVal<255 then
           PWMVal=PWMVal+1
           endif
        endif
    Steve

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

Similar Threads

  1. TMR0 stops working
    By shahidali55 in forum mel PIC BASIC Pro
    Replies: 25
    Last Post: - 9th May 2011, 05:59
  2. 16F628A - Stops if release power switch.
    By dene12 in forum General
    Replies: 16
    Last Post: - 14th February 2009, 07:57
  3. USART Stops Receiving Characters
    By breesy in forum Serial
    Replies: 7
    Last Post: - 26th November 2006, 03:50
  4. Ds1302 Stops are runs slow
    By Kman in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 13th June 2006, 02:10
  5. Button stops when i use Serin
    By SuB-ZeRo in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 8th July 2005, 14:35

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