some help with math


Results 1 to 40 of 65

Threaded View

  1. #24
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: some help with math

    If it’s bigger now, it won’t be if you put all of them in the same big array and skip to each group
    with an outer loop around that.

    Code:
    Event_OT var byte[8] ‘ or however many there are
    
    Event_OT_Day var Event_OT[0] ‘create alias to keep those names used elsewhere
    Event_OT_AllThoseOtherThings var Event_OT[1] ‘create alias
    …
    …
    
    index var byte ‘ this is re-useable for all of them
    
    if Event1_OT[0] >7 then 
    for index = 0 to 4
    Event_OT[index] = 0
    next index
    ENDIF

    You could check it isn’t cheaper to check for 0.
    It might not be now, but an earlier PBP, it would be cheaper.
    Code:
    'if Event_Penalty_Sec <1
    if Event_Penalty_Sec =0
    if your program uses the watchdog timer, there will be some buried in all of that.
    Code:
    DEFINE NO_CLRWDT
    You should get away with only one for that entire slab,
    and sprinkle any others only where needed
    Code:
    @ clrwdt
    definitely if there are any nops in code they can be replaced with them.
    Last edited by Art; - 11th September 2015 at 20:42.

Similar Threads

  1. Help with A/D math!
    By dbodenheimer in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 19th March 2011, 00:51
  2. Math help please...
    By Ioannis in forum General
    Replies: 2
    Last Post: - 20th June 2008, 10:18
  3. PBPL Math...new math takes more cycles...Always?
    By skimask in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 10th February 2008, 10:22
  4. Math help please!!!
    By jbirnsch in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 10th August 2007, 14:45
  5. math help
    By houa in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 30th January 2006, 16:58

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