|
Re: Stupidest Programming Mistakes
We've had QUITE a few:
to convert angle radians to degrees:
int tiltdeg = tiltrad*( (int)3.14 / 180 );
hmmm, no wonder why we kept getting "0" as a tile angle...
and oh yeah, it shoulda been 180/3.14 to begin with...
In trying to comment stuff out with "/* */", we realize that we comment out other stuff already commented out using the same method, and whenever it reached that comment's "*/" it would end, causing a bunch of syntax errors throughout the rest of the uncommented code, and we couldnt figure out for the life of us why it was reading that code...
and dont know what we were thinking here:
if(TILT_SERVO > Tilt_Servo_Max)
TILT_SERVO = Tilt_Servo_Max - Tilt_Servo_Min + Step_Size;
um, I think we were trying to have the camera search in the last area it saw the light if it immediately loses it too high...but um.. Tilt_Servo_Min = 0 and Step_Size is greater than 0...
|