Thread: PBasic Question
View Single Post
  #11   Spotlight this post!  
Unread 31-10-2002, 15:20
Matt Reiland's Avatar
Matt Reiland Matt Reiland is offline
'The' drive behind the drive
None #0226 (TEC CReW Hammerheads)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1999
Location: Troy Michigan
Posts: 712
Matt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond repute
Quote:
Originally posted by f22flyboy
startShift:
leftDrive=127
rightDrive=127
gear_shifting=1
gear_count=0




also what is this here for?

p1_sw_top_prev=p1_sw_top

I see that it sets p1_sw_top_prev=0 but why not just say that?
As for time, it will depend on the program length and the number of processor 'slots' you are using. The longer the program scan, the slower the delay will be.

Gear Count =0 will set up a fresh delay since it increments to 40 and stops incrementing until the next time a gear shift is requested. Gear Count would be at 40 coming into that statement

p1_sw_top_prev=p1_sw_top
this type of statement is useful for storing the value of the switch on the previous scan and checking the current state against what you had before to see if a change has taken place, kind of a 1-shot since after the current scan they will both agree again