View Single Post
  #34   Spotlight this post!  
Unread 15-02-2006, 17:21
slade24 slade24 is offline
AKA: Slick Daddy Ellis
AKA: Aaron Schultz
FRC #1370 (Blue Charge)
 
Join Date: Feb 2006
Rookie Year: 2004
Location: Middletown, DE
Posts: 6
slade24 is on a distinguished road
Re: Stupidest Programming Mistakes

My associate programmer decided to add Limit_Mix calls to the equations for joystick input / pwm output. He uploaded the code, but before we tested it he left, and took with him the updated code files (when I asked to get a copy, he uploaded only the .hex file onto my computer for some reason). Apparently he didn't read the Limit_Mix function correctly, because when we fired the robot up and began testing the ball launcher, it started spinning backwards!

In the dilemma that ensued, we reversed the polarity of the motor to get it to spin correctly (though we didn't know what was the original cause at the time). The launcher worked, but then we noticed its speed couldn't be adjusted.

Upon reaching home, I looked at the code (we post it onto a team wiki) and found... lo and behold, he forgot to add " + 2000" to the Limit_Mix calls. After fixing this error, I realized how lucky the team was to have remembered to take the drivetrain fuses out before testing the launcher -- all functions calling Limit_Mix were being returned as 0 (FULL REVERSE!).

We almost had a mass murdering robot (at least this years robot doesn't have a huge arm like last years -- now that would have been bad).
__________________
-- Time is my only enemy --

Middletown Robotics: Home