|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
help to rookie teams
Posted by Stephen at 1/25/2001 1:57 PM EST
Other on team #122, NASA Knights, from Grafton High School (Robotics team is at NHGS) and NASA. 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 |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How are all the rookie teams doing this year? | WakeZero | General Forum | 20 | 21-02-2009 12:02 |
| I tip my hat to all rookie teams | archiver | 2001 | 2 | 24-06-2002 02:25 |
| Hits, Misses, & Suggestions -- long message | archiver | 2000 | 17 | 23-06-2002 23:36 |
| The Case For 'Regionalizing' teams at the Nationals. | archiver | 2000 | 33 | 23-06-2002 23:35 |
| How do we view more teams? | archiver | 2000 | 0 | 23-06-2002 23:11 |