LESSON 12: Simple and Easy Way to Read Strings Floats and Ints over Arduino Serial Port

Поділитися
Вставка
  • Опубліковано 2 гру 2024

КОМЕНТАРІ • 155

  • @majdsaad622
    @majdsaad622 5 років тому +12

    Hi PAUL, I am a student from Lebanon and I want to truly thank u for these great videos that you are providing that are the best ones for this type of things.

  • @kobedde
    @kobedde 6 років тому +2

    Hi Paul,
    On the internet you will find a lot of information about this subject, but nowhere was the explanation so easy and well explained.
    I have already learned a lot through your lessons! Thank you for this.

  • @RockRanchCowboy
    @RockRanchCowboy 4 роки тому +1

    Mr. McWhorter, thank you so much for the work you've put into these educational videos. I'm currently programming an arduino-based seismograph from scratch for a college project; and I wouldn't have been able to do it without your videos. I just wanted to let you know that your hard work on these is much appreciated.

  • @hughpatterson1480
    @hughpatterson1480 2 роки тому

    What a great idea. Having your students really work with the serial monitor is a huge plus because the serial monitor is crucial for data analysis (although I really love the serial plotter). Another bit of work for my students who think they are going to have a four day weekend free of homework! Thanks Paul for yet another great lesson!

  • @franciscosanchez9406
    @franciscosanchez9406 9 років тому +3

    hi, Paul i want to thank you for all the lessons you made it had really helped me understand how the Arduino work!!!

  • @siimification
    @siimification 6 років тому +3

    Very good lectures. One thing I would ask - using waiting with "while (Serial.available()=0);" it doesn`T wait for the last question. If I am using 2 questions for example for blinking, after the entering first value, the second question shows itself for half a second and blinking starts itself. With this code, it waits 2 questions, but after that answer of second question is equal to the third question.

    • @fido3561
      @fido3561 6 років тому +3

      At the bottom of your Serial Monitor there are three boxes. The left one click on it and set it to "No line ending", set baud rate to 9600. Hope that will help.

    • @rbmnewton
      @rbmnewton 6 років тому

      @@fido3561 Thanks it worked :-)

    • @northadventure5654
      @northadventure5654 5 років тому

      @@fido3561 you are the best! I had the same problem, and I was about to get a new Arduino UNO hahaha

  • @jassiemorales-mariano103
    @jassiemorales-mariano103 9 років тому +4

    A big hand for you, sir. I just love the way you teach. :)

  • @ArduinoBasicsBlogspot
    @ArduinoBasicsBlogspot 9 років тому

    Excellent teaching style. Did not know those Serial methods existed. I have been doing this the long way for ages...
    Learnt something new today - thank you !!

  • @rajcodes100
    @rajcodes100 5 років тому +3

    Thanks Paul - you are systematically explaining stuff.

  • @kraskagm
    @kraskagm 9 років тому +2

    Really nice video, i was spending a week to read a string from serial port.

  • @wadeclary
    @wadeclary 9 років тому +8

    Good Morning Paul, First I'd like to say I really enjoy your teaching style! Best I've found on UA-cam regarding the Arduino. Second I'd like to ask if you would do some lessons on WiFi and Bluetooth Data/Audio. Thank you for your GREAT lessons!
    As for Graham Gilletts comments, and your cough. It doesn't bother me at all, because I'm completely engrossed in your lessons and your teaching style. Please don't stop posting during the juniper season! Unless you'er in to much discomfort! Your lessons are the best on UA-cam! Keep up that GREAT lessons!

    • @paulmcwhorter
      @paulmcwhorter  9 років тому +2

      +Wade Clary Thanks for the kind words. I have not played around with bluetooth much because my normal bluetooth products never work very well. To be honest, I have been pretty disappointed with that technology.

  • @xuanli2284
    @xuanli2284 7 років тому

    Thank you very much sir, you explain coding in the simplest way even for an Arduino beginner like myself. I have extensive experiences in making analogue circuits on veroboard, choosing ICs, however, that way seems a bit obsolete compared to the modern way of doing electronics. I must admit that coding makes things a lot easier and faster, and I wish you get well very soon. I am looking forward to seeing more of your videos!
    Regards
    Dr. Xuan Li

  • @bradklein4064
    @bradklein4064 10 років тому +1

    Thank you so much I was having an issue with reading a string and couldn't figure out where I was going wrong this video solved it

  • @rolandclauwaert2057
    @rolandclauwaert2057 3 роки тому

    Hallo, a very didactic lesson, even after "All those Years" Thank You, I hope you recovered well from your cough.

  • @alexbaxter9512
    @alexbaxter9512 7 років тому

    Well done Paul, the course thus far is both interesting and informative, you probably have the patience of Job.

  • @ayeshashafique6278
    @ayeshashafique6278 8 років тому +7

    Hi Sir!
    you are making great effort. May you get well soon or May you less suffer through this painful coughing.
    Thanks for your help.
    Sir I making voice robotic control car which uses arduino. Voice will be recognized through smart phone.Here will be using Bluetooth signal to send voice signal to arduino.
    Sir can you suggest me any tutorial or resource??
    Any kind of help would be great pleasure to me.
    Thank you in advance ..
    Stay blessed. :)!!

  • @naboulsikhalid7763
    @naboulsikhalid7763 8 років тому +1

    Hi, Mr.McWhorter. The lecons are made easy, simple and comprehensive. Thank you.

  • @Rob_TheOne
    @Rob_TheOne 3 роки тому

    Flying through the videos, thank you!

  • @SCSNZLTD
    @SCSNZLTD 7 років тому +2

    Your tutorials are amazing.

  • @davidprice2861
    @davidprice2861 6 років тому +5

    Hi Paul, you are a very good tutor.The way you cough makes me think you have irritable larynx or something similar in your throat, probably when you speak strongly for the video. maybe you could get a cough syrup or turn up the mic and speak more softly. Hope no offence taken, just letting you know. Regards, David.

  • @wenxuanz9119
    @wenxuanz9119 7 років тому

    Hello sir, I have a suggestion which is to implement something that checks if the user entered the info in the correct format. As it is right now if you enter things in the wrong format it will display 0 for all the variables. Also displaying what the user typed in can be useful too(printing after each prompt).
    Nevertheless, it's a very valuable lesson and thank you.

  • @JairoGustavo
    @JairoGustavo 9 років тому

    Hello i am from Ecuador, south America, thanks for your help, i had problems trying to read string data from serial monitor...excelent video!

  • @RobotKutusu
    @RobotKutusu 8 років тому

    Excellent way to teach. Greatings from Turkey.

  • @rjnmex
    @rjnmex 6 років тому

    Excellent teaching style. I'm trying to get an Arduino Leonardo board to read the serial output of machine vision camera.

  • @JohnDuthie
    @JohnDuthie 2 роки тому

    Thank you! I'm learning in a much more structured way with your videos compared to copy-pasting code from tutorials.

  • @alancousins1044
    @alancousins1044 5 років тому

    Hi Paul, thanks for the great lessons, why do you not put a semi colon on end of while statement but it does not give an error?

  • @Steve_be
    @Steve_be 5 років тому

    If you get time could you cover using the Arduino to receive Can data , filter the dates and how to respond it’s probably a bit much but I have learnt more about Arduino programming in your playlist, in a week than the last 6 months trying to follow a dummies guid, respect to you .. this OAP appreciates your work

    • @paulmcwhorter
      @paulmcwhorter  5 років тому +1

      Might think about moving over to my new arduino series. Redoing the lessons with better production, and more lessons.

  • @kquanchang664
    @kquanchang664 6 років тому +1

    Take care sir! it look really suffer.. hope u get well soon! thanks for the lecture and passion!

  • @bikefarmtaiwan1800
    @bikefarmtaiwan1800 6 років тому

    Really enjoying the lessons Paul- always try to do something different as well as what you suggest and the results are super satisfying. I watched the another video you made on how to become an engineer- very interesting. You have achieved an amazing amount no doubt down to dedication and enthusiasm. It may be of no help but my mum suffered from asthma only to find it was a milk allergy..... it would be great if this is helpful info for you :)

  • @S24W2
    @S24W2 Рік тому

    Thank you so much, fantastic videos, absolutely clear and very enjoyable

  • @kevinpinheiro2485
    @kevinpinheiro2485 7 років тому +1

    Im having a question.ill explain it with an example. Let's say there are 3 people a,b,c. What can we modify in the code such that if only the person a enters his name ,then the further questions will be asked. If b or c enter it wouldn't ask any of those questions but may be some other questions

  • @ronaldjkirby4874
    @ronaldjkirby4874 5 років тому

    Hi Paul , i decided to writhe this code out and test it and i have an error!! for some reason the height request just skips and prints out 0.00 for height , it wont let me enter anything , have you any suggestions pls

  • @johnrees44..G4EIJ
    @johnrees44..G4EIJ 4 роки тому

    Sir..
    First of all, I make no excuse for revealing my total obsession with your excellent videos...so thank you..
    I wonder if you would be kind enough tell me if there is one of your videos that might help me here..
    I have a one or two digit integer, updated every two seconds, being received by serial into a nano.. I need this integer to then update a variable in the receiving nano..
    Could you point me in the direction of any of your videos that might help with capturing and updating this variable..
    Thank you again.. John..UK

  • @packets2661
    @packets2661 5 років тому

    Thank you for all the lessons, well done!

  • @stevenmarshall8639
    @stevenmarshall8639 7 років тому

    Hello Paul,
    why doesn't the syntax turn orange in an Arduino sketch and i get an error message when I compile. exit status 1
    'myName' does not name a type

  • @PabloPerez-yh7ke
    @PabloPerez-yh7ke 8 років тому

    amazing, really easy, clean and simple, real art thanks

  • @gonza0076
    @gonza0076 9 років тому

    hi Paul. thanks for your videos i have lern a lot so long. i am programing a arduino to controll a temp and humidity rum for making salami just a project i jump on. i having a problem. i need to run 3 diferent temp and humidity in laps of 72 H.
    i am using a dht22 and a rtc. i have to programs one that i use to controll time and one that i can controll the humidity and dehumidity as well the temp and cooling. you point me in the rigth directon how to merge this 2 programs?

  • @frediabolo
    @frediabolo 6 років тому

    Now its really starting to click. Another great lesson.

  • @ventin75
    @ventin75 8 років тому +1

    Sir, how to specify the number of decimal places you want displayed?

  • @raviarora4749
    @raviarora4749 7 років тому

    Hey Paul McWhorter
    Shortcut keys for cut,copy and paste:
    Cut: Ctrl+x
    Copy: Ctrl+c
    Paste: Ctrl+v
    You were having some problem cutting , copying and pasting so I posted this.

  • @antonio-c.o.
    @antonio-c.o. 5 років тому

    Probably a silly question, but is 9.2 feet tall the same as 9.20 feet tall? I think in the first case it means feet and inches,while in the second case it means 9 feet and 20 hundredths of a foot... Said that, Mr.McWhorter, I love your lessons!

  • @JasonTang531
    @JasonTang531 7 років тому

    i was confusing with the problem about the serial communication between Matlab and Arduino before. After watching your video, im clear that string. int, float are what i need to use haha.

  • @iKostanCom
    @iKostanCom 6 років тому

    Great and simple as usual . Like it. However, it would be nice to add some bug fixing section... Thank you.

  • @felicity3105
    @felicity3105 7 років тому

    Very much helpful for a beginner !!! Thanks so so much for the videos and i would like you to share the tutorial videos on ATMEGA 16 programming with evaluation board.If Possible:)

  • @mouradmimouni4609
    @mouradmimouni4609 6 років тому

    Good morning Paul,
    I just discovered your classes and Arduino. Electronics is not my domain but I tinker a lot. I took your classes and I ordered the Arduino Kits to better follow and put into practice. Many thanks.
    I have questions about a small project that I would like to realize and I was wondering if Arduino could not be the solution.
    Can I send you a private email?
    cordial greetings.

  • @richardh568
    @richardh568 5 років тому

    Have any of you tried running this code on the new MEGA 2560 board? I'm getting strange results using this exact code. Just curious......

  • @McGavel1
    @McGavel1 8 років тому

    Cool practice with variables & IPO - thanks!

  • @duenohfao9850
    @duenohfao9850 7 років тому

    I edited your code and got this(comments excluded):
    String myName;
    int age;
    float meterHeight;
    float feetHeight;
    void setup() {
    // put your setup code here, to run once:
    Serial.begin(9600);
    }
    void loop() {
    // put your main code here, to run repeatedly:
    Serial.println("What is your name?");
    while (Serial.available() == 0) {
    }
    myName = Serial.readString();
    Serial.println("What is your age?");
    while (Serial.available() == 0) {
    }
    age = Serial.parseInt();
    while (age == 0) {
    Serial.println(" ");
    Serial.println("Error. Pls enter your age again. ");
    Serial.println("What is your age?");
    while (Serial.available() == 0) {
    }
    age = Serial.parseInt();
    Serial.println(" ");
    }
    Serial.println("What is your height? (in meters)");
    while (Serial.available() == 0) {
    }
    meterHeight = Serial.parseFloat();
    while (meterHeight == 0) {
    Serial.println(" ");
    Serial.println("Error. Pls enter your height again. ");
    Serial.println("What is your height? (in meters)");
    while (Serial.available() == 0) {
    }
    meterHeight = Serial.parseFloat();
    }
    feetHeight = (3.28084/1.)*meterHeight;
    Serial.println(" ");
    Serial.print("r");
    delay(50);
    Serial.print("e");
    delay(50);
    Serial.print("a");
    delay(50);
    Serial.print("d");
    delay(50);
    Serial.print("i");
    delay(50);
    Serial.print("n");
    delay(50);
    Serial.print("g");
    delay(50);
    Serial.print(" ");
    delay(50);
    Serial.print("d");
    delay(50);
    Serial.print("a");
    delay(50);
    Serial.print("t");
    delay(50);
    Serial.println("a");
    Serial.println(" ");
    Serial.print("r");
    Serial.print("e");
    Serial.print("a");
    Serial.print("d");
    Serial.print("i");
    Serial.print("n");
    Serial.print("g");
    Serial.print(" ");
    Serial.print("s");
    Serial.print("u");
    Serial.print("c");
    Serial.print("c");
    Serial.print("e");
    Serial.print("s");
    Serial.print("s");
    Serial.print("f");
    Serial.print("u");
    Serial.println("l");
    Serial.println(" ");
    Serial.print("Hi ");
    Serial.print(myName);
    Serial.println(". ");
    Serial.print("You are ");
    Serial.print(age);
    Serial.println(" years old, ");
    Serial.print("You are ");
    Serial.print(meterHeight);
    Serial.println("m tall.");
    Serial.print("Which is ");
    Serial.print(feetHeight);
    Serial.println("feet tall.");
    Serial.println(" ");
    Serial.println(" ");
    }

  • @raviarora4749
    @raviarora4749 7 років тому

    Paul also werent we supposed to input height and not weight

  • @markdunham9949
    @markdunham9949 4 роки тому

    I'm curious. Why did the statement "please enter your name" repeat while the other questions did not repeat? all of the questions are within the same braces of the loop.
    and how do you take out the repetition of the question?

    • @paulmcwhorter
      @paulmcwhorter  4 роки тому

      Make sure serial monitor is set to no line ending.

    • @markdunham9949
      @markdunham9949 4 роки тому

      @@paulmcwhorter Thanks. I see that it is that way by design in order to take more user input.

  • @pero828
    @pero828 8 років тому

    Thank you for making videos, they are really helpful and simple. However, I have a problem. It seems that when I read srings/floats/ints every other line gets skipped so I need to make a line after every important line where I put some unimportant variable to skip skip the line and then I can again type in the important one. If there is the way to fix it, please someone let me know.

  • @mauriziomoris769
    @mauriziomoris769 4 роки тому

    Ho, where Can i fondi The code? Ty Very much

  • @maxisiegl4804
    @maxisiegl4804 6 років тому

    Finally a simple way.
    Edit:Good video btw

  • @saptangshumanna9919
    @saptangshumanna9919 7 років тому

    Is there a BREAK statement available in arduino like in java. And I hope you will get a new cable :@

  • @saptangshumanna9919
    @saptangshumanna9919 7 років тому

    Hey when did you coded the last sketch

    • @aboriani
      @aboriani 7 років тому

      You are supposed to do it yourself and not just copy it...

  • @Jai_Lopez
    @Jai_Lopez 7 років тому

    how can i convert a char into a string?
    what's wrong with what im gathering from the net is not working for me, im having visual studios and or processing sending out this function over serial to the same com port 9 at the same baud rate and i get nothing, the only way this code above will execute is if i change the datatype to char on the arduino side despite the fact that both visual studios 2013 and processing are sending out strings over serial
    [code]
    String id;
    int led = 6;
    void setup() {
    Serial.begin(9600);
    pinMode(led, OUTPUT);
    }
    void loop()
    {
    id = Serial.readString();
    if (id == "1")
    {
    digitalWrite(led, HIGH);
    }
    /* PROCESSING*/
    if (mousePressed == true)
    { //if we clicked in the window
    myPort.write('1'); //send a 1
    } else
    { //otherwise
    myPort.write('0'); //send a 0
    }
    }
    /*VisualStudios */
    if (r == "switch") { port.Open(); port.WriteLine("1"); port.Close(); }
    [/code]
    hope this helps you help me

  • @hakankarakurt1100
    @hakankarakurt1100 9 років тому

    MR. McWorther can you please help me?
    Here is my case:(where brightness and delaytime are ints)
    while (Serial.available()==0){}
    brightness = Serial.parseInt();
    delaytime = Serial.parseInt();
    In this case I know why it doesn't stop for delaytime but I tried many ways to make it stop for delaytime(if, while, etc.)... So can you please help me?
    How can I stop the serial port or the loop for me to type another int as well because serial.available==0 works only for one int...

    • @hakankarakurt1100
      @hakankarakurt1100 9 років тому

      Oh I've written it just before I watched lesson13 and it answered my question. But I tried the same method and it didn't work. I don't really know why... I seperated brightness and delaytime just like you did to age and name and height. But when I type the brightness to serial port it just skips the delaytime part. The LED turns on for a very short moment and then it stops in the part it gets brightness...

  • @gilnasty82
    @gilnasty82 2 роки тому

    This one was pretty easy but really fun!! Too bad I'm not as valuable as diamonds!! Thats a lot of carats!!! 🤣🤣 Thanks Paul!!

  • @gamingpahogniva5488
    @gamingpahogniva5488 7 років тому +1

    Here is the homework
    String myName;
    float weight;
    float pounds;
    float grams;
    float carat;
    float ounces;
    void setup() {
    // put your setup code here, to run once:
    Serial.begin(9600);
    }
    void loop() {
    // put your main code here, to run repeatedly:
    Serial.println("What´s your name?");
    while (Serial.available()==0){ }
    myName = Serial.readString();
    Serial.println("Whats your weight (in kg)?");
    while(Serial.available()==0);{ };
    weight = Serial.parseFloat();
    pounds= weight*2.2;
    grams= weight*1000;
    carat=weight*5000;
    ounces= weight*35;
    Serial.print("Hello ");
    Serial.println(myName);
    Serial.print("Your weight is: ");
    Serial.print(weight);
    Serial.println(" Kg");
    Serial.print("And that is: ");
    Serial.print(pounds);
    Serial.println(" pounds");
    Serial.print("And also: ");
    Serial.print(grams);
    Serial.println(" grams");
    Serial.print("And also: ");
    Serial.print(carat);
    Serial.println(" carat");
    Serial.print("And also: ");
    Serial.print(ounces);
    Serial.println(" ounces");
    Serial.println(" ");
    Serial.println("And next person!!!");
    Serial.println(" ");

    }

    • @zlackbiro
      @zlackbiro 6 років тому

      GamingPåHögNivå: Who do you have to meny prints out for variables. Who cant do this in one single row whan you need? Eg: Serial.print(Your name is $myName and you are $age old with $heigh at hight)

  • @kinaliender
    @kinaliender 5 років тому

    Thank you so much Sir. I search for "wait for input" . I tried your method and I succeed.
    void loop() {
    String kartNo; //variable
    while(Serial.available() == 0)
    {
    kartNo = Serial.readString(); // read input from serial
    Serial.print(kartNo); //write this to serial
    }
    }

  • @jirkasmejkal1698
    @jirkasmejkal1698 7 років тому

    Wh you dont use bytes, it would save the space even more, especialy wjith larger and more complex codes

  • @4funrc11
    @4funrc11 7 років тому

    Question(s): Why wasn't *_concatenation_* used for serial output?
    Would using *_concatenation_* use more or less memory?

    • @paulmcwhorter
      @paulmcwhorter  7 років тому +2

      I try to do things in the most easy way to understand for beginners, not always the best or most efficient, but the easiest to understand.

    • @4funrc11
      @4funrc11 7 років тому

      Paul McWhorter
      Gotcha, thx!
      I'm certainly enjoying -the living-hell outta- this stuff.

  • @nogrend
    @nogrend 10 років тому +1

    It's helpful for my project, thank you.
    NL

  • @chetanrohila5575
    @chetanrohila5575 4 роки тому

    You are great paul

  • @geekyourlikeslulu
    @geekyourlikeslulu 5 років тому

    Can't I just do >>> Serial.println("Hello, " + myName + ", you are " + age + " years old.") ???? I'm really asking if its possible or not.

  • @MehediHasan-fs2vg
    @MehediHasan-fs2vg 5 років тому

    Sir, i am learning coding in Arduino. I have tried the same code . Even i copied and pasted the code you uploaded. But still it does not show the height. The Arduino simply escape the height. Whats the wrong? Can you help me out?

    • @paulmcwhorter
      @paulmcwhorter  5 років тому

      Make sure serial monitor is set to no line ending.

    • @MehediHasan-fs2vg
      @MehediHasan-fs2vg 5 років тому

      @@paulmcwhorter Sir, Thank you very much. I made it "No line ending" and it is working now.

  • @JohnDoe-fv5cu
    @JohnDoe-fv5cu 6 років тому

    It's interesting, but my personal experience shows that using strings with serial port communication is way too slow in many cases. I'd rather prefer to use some shorter byte commands and create some kind of like a simple binary protocol for this purpose

    • @paulmcwhorter
      @paulmcwhorter  6 років тому +1

      Being a series for beginners, I focus on the easiest way to do things, which is not always the best way.

  • @vinayverma3138
    @vinayverma3138 5 років тому

    something is wrong with my serial monitor because after asking the age it does not wait and gives the output
    i have followed each step correctly but problem still exist
    please help

    • @jynclr
      @jynclr 5 років тому

      In serial monitor window, at the very bottom to the right, you'll see 2 drop downs and a button. The drop down on the left should have an option that says, "No line ending." Make sure that it selected. He literally says it at 24 minutes in.

  • @ajaysoni5370
    @ajaysoni5370 8 років тому

    hello sir , sir how to read string data from Bluetooth and how to store in char array by arduino then print

  • @zlackbiro
    @zlackbiro 6 років тому

    Who do you have to meny prints out for variables? Why cant do this in one single row whan you need? Eg: Serial.print(Your name is $myName and you are $age old with $heigh at hight)
    - How to do that?
    Note: $variable is from PHP programming that we can place the variable enywhere in the PHP block of the code.

  • @CN-kc3em
    @CN-kc3em 5 років тому

    Thanks, Mr Paul.

  • @harryt5030
    @harryt5030 3 роки тому

    how to show error, if input is as not expected.

  • @MikevomMars
    @MikevomMars 3 роки тому

    After watching this video, i inevitably started coughing.

  • @shivam1623
    @shivam1623 4 роки тому

    Why has he kept a watch?

  • @nikhildalvi237
    @nikhildalvi237 4 роки тому

    While loop with float is generating only 0.00

  • @rishi4997
    @rishi4997 5 років тому

    Btw how come people ask "how old are you?" For age; and not ask "How heavy are you?" For weight?

  • @S24W2
    @S24W2 Рік тому

    Soneone get that poor man a glass of water

  • @bankcupd6159
    @bankcupd6159 10 років тому +1

    Thank you so much.

  • @mrcanisters
    @mrcanisters 5 років тому

    best tutorials :)

  • @juan.mazzeo
    @juan.mazzeo 5 років тому

    Loved this thanks

  • @howardtang8720
    @howardtang8720 6 років тому +26

    everyone watch this video, he needs money to buy cough drops...
    actually great video though :)

  • @PankajSharma-kk1ci
    @PankajSharma-kk1ci 4 роки тому

    Serial.print("Your weight in Kg: ");
    Serial.println(weightkg);
    Serial.print("Your weight in pound: ");
    Serial.println(weightkg*2.204);
    Serial.print("Your weight in Gram: ");
    Serial.println(weightkg*1000);
    Serial.print("Your weight in Carat: ");
    Serial.println(weightkg*5000);
    Serial.println("");
    Output
    Your weight in Kg: 60
    Your weight in pound: 132.24
    Your weight in Gram: -5536
    Your weight in Carat: -27680
    When I am enter above code, I am getting weight in Gram and Carat negative as above while multiplying by 1000 gram and 5000 carat which is incorrect (Connverting Kg). While when I am changing it to 100 gram and 500 carat (to check). I am getting correct result as below
    Your weight in Kg: 60
    Your weight in pound: 132.24
    Your weight in Gram: 6000
    Your weight in Carat: 30000
    I am not able to identify error. Please guide

  • @omarmero1
    @omarmero1 8 років тому

    the arduino can't recognize Serial.readString but it recognize Serial.parseInt

    • @binness
      @binness 8 років тому

      then you are doing something wrong my friend, go back and make sure the spelling is correct, the brackets are there, as well as the semi-colon, all I can say is it works fine for me.

    • @lawrencemao6519
      @lawrencemao6519 8 років тому +1

      lmao, I know this is late but I think you set the value as a string instead of an integer. Keep in mind that *Serial.readString applies only to strings* and *Serial.parseInt only applies to integers.*

  • @bogus_not_me
    @bogus_not_me 5 років тому

    I can see the value of learning the various "Serial." commands, but this isn't very practical. I think it's too simplistic to ask someone to enter all that info then parrot it back to them. You said "height" was a float, but didn't tell them to enter height as a decimal number. Most people respond as "feet" and "inches", so it would look more like a string. If asked my height, my normal response is "6 foot 1". Same thing for age - what if they respond with "years, months".I would have liked it better if we could read the info into the Arduino and tell them BMI, for instance - although most people might not like that.

  • @654785439
    @654785439 10 років тому

    great video

  • @howardtang8720
    @howardtang8720 6 років тому +1

    Why would you write serial.available == 0 for asking your name? wouldn't == 0 mean it is an integer and not a string?

    • @Fabonikazell
      @Fabonikazell 6 років тому

      Serial.available has boolean values which are 1 and 0.
      1 for true, 0 for false. You got it all mixed up. Serial.available == 0 means it has a value of false which basically tells that there is no value inputted yet in the serial port.

  • @gandist6095
    @gandist6095 5 років тому

    really great

  • @chetanrohila5575
    @chetanrohila5575 4 роки тому

    Love from india

  • @pachonX
    @pachonX 8 років тому

    Thanks a lot!

  • @matthewmorrison2071
    @matthewmorrison2071 4 роки тому

    float Pounds;
    float Ounces;
    float Grams;
    float Carats;
    void setup() {
    Serial.begin(115200);
    }
    void loop() {
    Serial.println("How much do you weigh(pounds)");
    while (Serial.available()==0) { };
    Pounds = Serial.parseFloat();
    Ounces = Pounds * 16;
    Grams = Pounds * 453.592;
    Carats = Pounds * 2267.96;
    Serial.println("You weigh:");
    Serial.print(Pounds);
    Serial.println(" Pounds");
    Serial.print(Ounces);
    Serial.println(" Ounces");
    Serial.print(Grams);
    Serial.println(" Grams");
    Serial.print(Carats);
    Serial.println(" Carats");
    }

  • @raviarora4749
    @raviarora4749 7 років тому

    Oh sorry you corrected it

  • @thelamb288
    @thelamb288 4 роки тому

    start (for me) @ 16 mins in.

  • @nielsdaemen
    @nielsdaemen 8 років тому +7

    Looks like he is hoarding tabs in chrome. Why would anyone need so many websites to be opened?

    • @paulmcwhorter
      @paulmcwhorter  8 років тому +8

      Yes, and I have lots of browsers open, each with at least that many tabs. Lots of interests to keep up with and a tab open for each.
      PJM

    • @nicewhenearnedrudemostlyel489
      @nicewhenearnedrudemostlyel489 6 років тому +1

      Let's leave it at, there is a reason, the people that made it, made it able to do that.
      There is also a reason why people use it, the way it was built.

    • @iKostanCom
      @iKostanCom 6 років тому +1

      Same shit, about 20 tabs opened...

  • @srijansagar1250
    @srijansagar1250 4 роки тому +1

    💖💖💖💖💖💖💖💖

  • @JesusIsGodson
    @JesusIsGodson 5 років тому

    Are you PaulS

    • @paulmcwhorter
      @paulmcwhorter  5 років тому

      No, I am not but in the past I have had difficulty and asked questions on arduino forums, and PaulS answered and helped me. I dont know who he is, but he really seems to be a very smart guy, and a very nice and helpful guy.

  • @bombadeagua
    @bombadeagua 9 років тому

    Thanks

  • @paramveerpanwar8455
    @paramveerpanwar8455 10 років тому

    thank u sir

  • @farazaslam7445
    @farazaslam7445 4 роки тому +1

    Can't listen past the cough man... Next video....

  • @mikejohnson1539
    @mikejohnson1539 5 років тому +1

    That is such an annoying cough

  • @lil_zcrazyg1917
    @lil_zcrazyg1917 6 років тому

    *clicks on video* Ahh, just one more like before he dies *immediately leaves video*