Hello every one.
I am new user of teensy and i am using teensy3.2 i want to get float value from serial monitor but when i enter any float value it returns me accurate value but with garbage value like 0.00
its my code
when i enter any number my output is like the picture that i have uploaded.
Please guide me how can i fix this issue.
I am new user of teensy and i am using teensy3.2 i want to get float value from serial monitor but when i enter any float value it returns me accurate value but with garbage value like 0.00
its my code
Code:
float val;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
}
void loop() {
// put your main code here, to run repeatedly:
while(Serial.available()==0){}
val=Serial.parseFloat();
Serial.print("You Entered=");
Serial.println(val);
}
Please guide me how can i fix this issue.