New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sin() does not work in 20120903 (Windows) #307
Comments
Probably related to #283 |
Per JK and #283 we were building for Uno32 |
It's possible to take the platforms.txt, and boards.txt file from the Make a back up of those files just in case, but that should work. -_Rick On Fri, Dec 21, 2012 at 5:57 AM, ghostface1985 notifications@github.comwrote:
Co-founder |
I just verified that this was indeed the issue that caused the sin() to not work for us. So this issue is resolved and will be picked up in the next release. |
The following code demonstrates a failure in the sin() in version 20120903 of MPIDE.
The MAG Lab guys in Pomona, CA working on there chipKIT contest found this issue.
Jacob
/*
sin() test
*/
void setup()
{
Serial.begin(9600);
Serial.println("sin() test");
}
double tau = 6.28318530717958647692528676655900576839433879875021;
double pi = 3.141592653589793238462643383279502884197169399375105;
double rad = 0;
void loop()
{
if( rad > tau ) {
Serial.println("press any key to print table");
while( !Serial.available() )
; // do nothing
Serial.read();
rad = 0;
}
Serial.print("sin(");
Serial.print(rad);
Serial.print(") = ");
Serial.print(sin(rad));
Serial.println("");
rad += tau / 16;
}
Output:
sin() test
sin(0.00) = 0.00
sin(0.39) = 0.39
sin(0.79) = 0.79
sin(1.18) = 1.18
sin(1.57) = 1.57
sin(1.96) = 1.96
sin(2.36) = 2.36
sin(2.75) = 2.75
sin(3.14) = 3.14
sin(3.53) = 3.53
sin(3.93) = 3.93
sin(4.32) = 4.32
sin(4.71) = 4.71
sin(5.11) = 5.11
sin(5.50) = 5.50
sin(5.89) = 5.89
press any key to print table
Expected output:
sin() test
sin(0.00) = 0.00
sin(0.39) = 0.38
sin(0.79) = 0.71
sin(1.18) = 0.92
sin(1.57) = 1.00
sin(1.96) = 0.92
sin(2.36) = 0.71
sin(2.75) = 0.38
sin(3.14) = 0.00
sin(3.53) = -0.38
sin(3.93) = -0.71
sin(4.32) = -0.92
sin(4.71) = -1.00
sin(5.11) = -0.92
sin(5.50) = -0.71
sin(5.89) = -0.38
press any key to print table
The text was updated successfully, but these errors were encountered: