Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: Garbage value on serial monitor using teensy 3.2

Threaded View

  1. #1
    Junior Member
    Join Date
    Feb 2019
    Posts
    17

    Garbage value on serial monitor using teensy 3.2

    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
    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);
    }
    when i enter any number my output is like the picture that i have uploaded.
    Please guide me how can i fix this issue.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	1.PNG 
Views:	27 
Size:	47.9 KB 
ID:	15910  

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •