View Single Post
  #11   Spotlight this post!  
Unread 15-05-2004, 12:55
Joshua May's Avatar
Joshua May Joshua May is offline
Go Bears!
FRC #1110 (Binary Bulldogs)
Team Role: College Student
 
Join Date: Nov 2003
Rookie Year: 2003
Location: Berkeley, CA
Posts: 1,306
Joshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond repute
Send a message via AIM to Joshua May
Re: 2001 2002 in Automous

Here I've made an attempt at re-writting this code in PBasic for the 2001-2002 controllers, here is the section of code, it SHOULD work, but I have no method of testing it right now. Also, for this to work, the variables "toggled" "prev_toggle" and "run_auto" must be created and initially set to 0.

Code:
  IF (p1_aux = 1) & (prev_toggle = 0) THEN Toggler:
  Toggler:
    toggled = 1
    run_auto = 1
  prev_toggle = p1_aux

  IF (p1_aux = 1) & (run_auto = 1) THEN StopAuto:
  StopAuto:
    toggled = 0
    run_auto = 0

  IF (run_auto = 1) THEN GoAuto:
    driveR = (((2000 + p1_y + p1_x - 127) MIN 2000 MAX 2254) - 2000)
    driveL = (((2000 + p1_y - p1_x + 127) MIN 2000 MAX 2254) - 2000)
  GoAuto:
   ' Autonomous Code Goes Here
Just place this code into the drive section and hopefully it will work. I don't have much experience with PBasic, so if there are any errors, please tell me.
__________________
The FIRST Wiki - openFIRST - Ultimate Robot Challenge - URC Wiki
I currently have 50 GMail invites, PM or email me for one.
UC Berkeley Class of 2009

2005 Las Vegas Regional Autodesk Visualization Award
2005 Las Vegas Regional #8 Seeded Alliance with 988 and 1505
2006 Southern California Regional #15 seed