Okay, thanks. We're using the FTC stuff - an NXT programmed with RobotC - Do the FPGA issues apply to that, as well?
Okay - I think I may have found the issue. I was watching the variables and noticed at position (127,0) on the joystick, W1 and W2 were being sent 0's. The Joystick was scaled by dividing by 1.28 (Because 128 was the maximum negative value)
The code I used is:
Code:
W1 = (- 1/2 * 99) - (sqrt(3)/2 * 0)
To test if I was off in my order of operations, I parenthesized more fully the code:
Code:
W1 = ((-1 * (1/2)) * 99) - (((sqrt(3))/2) * 0)
And ran those calculations on RobotC - both returned 0. On a TI-89, they returned -49.5, which is what I expected.
I dove a bit deeper - I tried each individual expression.
Code:
float test = -1/2;
writeDebugStreamLine("%d", test);
Returned 0.
Then,
Code:
float test = -.5;
writeDebugStreamLine("%d", test);
Returned -1090519040.
sqrt(3)/2 returned 1063105496 - Any idea what the problem is?
EDIT 2:
Tested the sample math program, everything worked. It printed to the NXT screen, so I told it to print to the debug stream as well - lo and behold, something mucked up the numbers in between. I changed the code on the NXT to be -.5 instead of -1/2 and it works fine now - Why is that?