Generating Timed Fades in PBP - ideas ?


Closed Thread
Results 1 to 3 of 3

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    I seems to work OK for values I try, but I might need to try with some weird values to see if it still holds up - 33 - 101 over 5 seconds ??
    (68 steps over 5 seconds or 50 interrupts = change by 1.36 per interrupt !! aaarg !)
    ( Start value - End value ) / ( time * 10 )
    ( 33 - 101 ) = use the ABS function to get the real difference between the 2 = 68
    ( 5 * 10 ) = 50
    68 / 50 = 1.36
    True, not doable in PBP...but...a bit of scaling will take care of that...

    68 * 100 = 6800 / 50 = 136

    Keep track of your steps/interrupts...
    1st step = 6800 / 50 * step (1 in this case) = 136 / 100 = 1.36, rounds down to 1, add to start = 34
    2nd step = 6800 / 50 * 2 = 272 / 100 = 2.72, rounds down to 2, add to start = 35
    3rd step = 6800 / 50 * 3 = 408 / 100 = 4.08, rounds down to 4, add to start = 36
    ...blah blah blah...
    49th step = 6800 / 50 * 49 = 6664 / 100 = 66.64, rounds down to 66, add to the start value = 99.
    50th step = 6800 / 50 * 50 = 6800 / 100 = 68, add to start value = 101

  2. #2
    Join Date
    Feb 2003
    Location
    Sydney, Australia
    Posts
    126


    Did you find this post helpful? Yes | No

    Default

    cool thanks for that - today I am going to try a bit of coding to see how it runs.

    bill

Similar Threads

  1. PBP Book
    By Bruce in forum Off Topic
    Replies: 83
    Last Post: - 4th October 2021, 12:55
  2. Any idea's on porting this to PBP?
    By Ryan7777 in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 10th October 2008, 19:21
  3. Compiler differences between PBP 2.33 & 2.46
    By nikopolis in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd May 2006, 19:01
  4. Newby- PBP wont compile for 18F (MPLAB)
    By jd76duke in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th December 2005, 23:30

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