vinodstanur 0 Posted February 10, 2013 Share Posted February 10, 2013 Hi, I am using arm-none-eabi-xxx for stellaris launchpad develpment. I tried the math library but sin, cos functions are not returning any thing if I pass variable arguments but it is working with constant arguments. Any idea? Quote Link to post Share on other sites
energia 485 Posted February 10, 2013 Share Posted February 10, 2013 I assume that you are using Energia to compile and thus use the compiler supplied with Energia? If you are using a different compiler then you might want to try the general forum. The Sketch below works for me. void setup() { Serial.begin(115200); } float deg2rad(float deg) { return (deg * PI)/180.0f; } float deg = 0; float s; void loop() { Serial.print("sin("); Serial.print(deg); Serial.print(") = "); Serial.println(sin(deg2rad(deg)), DEC); deg += 1; if(deg > 360) deg = 0; delay(100); } bluehash 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.