View Single Post
  #5   Spotlight this post!  
Unread 23-06-2002, 23:38
archiver archiver is offline
Forum Archival System
#0047 (ChiefDelphi)
 
Join Date: May 2001
Location: Pontiac, MI
Posts: 21,214
archiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond repute
Re: help to rookie teams

Posted by Patrick Dingle at 1/27/2001 8:15 PM EST


Other on team #639, Red B^2, from Ithaca High School and Cornell University.


In Reply to: help to rookie teams
Posted by Stephen on 1/25/2001 1:57 PM EST:



maybe next year innovation FIRST will enable us to download COMPILED code? It would be much faster and we could use programming languages that don't assign the universal AND symbol (^) to mean exclusive or (XOR)! Anyway, thanks for the post. I had seen the trick before but forgot all about it.

Patrick

: This post is meant as a programming tip for rookie teams. For the past few years (well, this is what I've been told, this is actually my first year at FIRST) my team has used a button on the robot to reverse the controls; in escence switching the motors you send the certain joystick controls to. This helps to stop the disorientation you get when the robot is turned around and you have to mentally swap everything around. Well, now to the point: as you now, you are only permited 26 varibles in pbasic, and most teams (even mine last year) use a temp variable to swap:
: - temp = a
: - a = b
: - b = temp
: but, this wastes a varible. Here is very simple way to swap the varible using bitwise operations:
: - a = a ^ b
: - b = a ^ b
: - a = a ^ b
: If you want help understanding the logic, or have problems implementing this code - send me an e-mail at Steven3554@yahoo.com


__________________
This message was archived from an earlier forum system. Some information may have been left out. Start new discussion in the current forums, and refer back to these threads when necessary.