Skip to content
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

Closed
JacobChrist opened this issue Dec 15, 2012 · 5 comments
Closed

sin() does not work in 20120903 (Windows) #307

JacobChrist opened this issue Dec 15, 2012 · 5 comments

Comments

@JacobChrist
Copy link
Member

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

@jasonkajita
Copy link
Contributor

Probably related to #283

@JacobChrist
Copy link
Member Author

Per JK and #283 we were building for Uno32

@ricklon
Copy link
Member

ricklon commented Dec 21, 2012

It's possible to take the platforms.txt, and boards.txt file from the
latest build and copy over the platforms.txt, boards.txt file of that build.

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:

After all is there any way to fix this issue with SIN() function in this
version of MPIDE (20120903) for Windows ???
Are there any other issues regarding this version of MPIDE (20120903) for
Windows ???

Sincerelly,
Bogdan !


Reply to this email directly or view it on GitHubhttps://github.com//issues/307#issuecomment-11609331.

Co-founder
Fair Use Building and Research (FUBAR) Labs
http://fubarlabs.org

@JacobChrist
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@JacobChrist @ricklon @jasonkajita and others