This assignment (due yesterday) has some pretty specific instructions like declare alphaDeg as float and use Serial.print() to print to the serial monitor. We are using this code for an arduino board robot.
But everytime that I have tried to compile it, I keep getting this error message. I am really new to C programming, and our textbook doesn't have anything about troubleshooting errors like this.
I even asked my teacher and she said to split up the Serial.print("statement") and the Serial.print("%f", alphaDeg) and it should compile, but it still doesn't. When I try to google the problem or look through the forums, every question is much more complicated than the answer that I need.
My main question is what does this error mean and how do I correct it?
My secondary question is if this is the easiest way that I can code this simple function?
Error code->
parse error: 'print': one or more arguments do not match earlier function prototype or forward function-call
(highlights line 5)
1 void setup(void){
2 // degrees to radians
3 float alphaDeg = 45.0;
4 float alphaRad = alphaDeg * (PI / 180.0);
5 Serial.print("%f", alphaDeg);
6 Serial.print(" in degrees is ");
7 Serial.print("%f", alphaRad);
8 Serial.println(" in radians.");
}
Nevermind the difference question...
I'm realizing that they are the same print() just for different things.
So what am I doing wrong that is causing a parse error?