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.
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.
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.
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!
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.
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.
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 !!
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!
+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.
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
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. :)!!
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.
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.
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
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 :)
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
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
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
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
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?
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.
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!
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.
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:)
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.
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?
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.
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
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...
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...
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)
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 } }
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?
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
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
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.
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.
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
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.
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.*
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.
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.
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.
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.
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.
wle mn wen
Bro I hope you're fine
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.
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.
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!
Absolutely!
hi, Paul i want to thank you for all the lessons you made it had really helped me understand how the Arduino work!!!
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.
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.
@@fido3561 Thanks it worked :-)
@@fido3561 you are the best! I had the same problem, and I was about to get a new Arduino UNO hahaha
A big hand for you, sir. I just love the way you teach. :)
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 !!
Thanks Paul - you are systematically explaining stuff.
Really nice video, i was spending a week to read a string from serial port.
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!
+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.
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
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
Hallo, a very didactic lesson, even after "All those Years" Thank You, I hope you recovered well from your cough.
Well done Paul, the course thus far is both interesting and informative, you probably have the patience of Job.
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. :)!!
Ayesha Shafique
Hi, Mr.McWhorter. The lecons are made easy, simple and comprehensive. Thank you.
Flying through the videos, thank you!
Enjoy!
Your tutorials are amazing.
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.
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.
Hello i am from Ecuador, south America, thanks for your help, i had problems trying to read string data from serial monitor...excelent video!
Excellent way to teach. Greatings from Turkey.
Excellent teaching style. I'm trying to get an Arduino Leonardo board to read the serial output of machine vision camera.
Thank you! I'm learning in a much more structured way with your videos compared to copy-pasting code from tutorials.
Glad to help!
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?
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
Might think about moving over to my new arduino series. Redoing the lessons with better production, and more lessons.
Take care sir! it look really suffer.. hope u get well soon! thanks for the lecture and passion!
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 :)
Thank you so much, fantastic videos, absolutely clear and very enjoyable
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
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
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
Thank you for all the lessons, well done!
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
amazing, really easy, clean and simple, real art thanks
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?
Now its really starting to click. Another great lesson.
Sir, how to specify the number of decimal places you want displayed?
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.
Hey, you really have some good suggestions. Thanks!
Thanks
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!
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.
Great and simple as usual . Like it. However, it would be nice to add some bug fixing section... Thank you.
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:)
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.
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......
Cool practice with variables & IPO - thanks!
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(" ");
}
Paul also werent we supposed to input height and not weight
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?
Make sure serial monitor is set to no line ending.
@@paulmcwhorter Thanks. I see that it is that way by design in order to take more user input.
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.
Ho, where Can i fondi The code? Ty Very much
Finally a simple way.
Edit:Good video btw
Is there a BREAK statement available in arduino like in java. And I hope you will get a new cable :@
Hey when did you coded the last sketch
You are supposed to do it yourself and not just copy it...
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
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...
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...
This one was pretty easy but really fun!! Too bad I'm not as valuable as diamonds!! Thats a lot of carats!!! 🤣🤣 Thanks Paul!!
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(" ");
}
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)
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
}
}
Wh you dont use bytes, it would save the space even more, especialy wjith larger and more complex codes
Question(s): Why wasn't *_concatenation_* used for serial output?
Would using *_concatenation_* use more or less memory?
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.
Paul McWhorter
Gotcha, thx!
I'm certainly enjoying -the living-hell outta- this stuff.
It's helpful for my project, thank you.
NL
You are great paul
Can't I just do >>> Serial.println("Hello, " + myName + ", you are " + age + " years old.") ???? I'm really asking if its possible or not.
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?
Make sure serial monitor is set to no line ending.
@@paulmcwhorter Sir, Thank you very much. I made it "No line ending" and it is working now.
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
Being a series for beginners, I focus on the easiest way to do things, which is not always the best way.
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
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.
hello sir , sir how to read string data from Bluetooth and how to store in char array by arduino then print
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.
Thanks, Mr Paul.
how to show error, if input is as not expected.
After watching this video, i inevitably started coughing.
Why has he kept a watch?
While loop with float is generating only 0.00
Btw how come people ask "how old are you?" For age; and not ask "How heavy are you?" For weight?
Soneone get that poor man a glass of water
Thank you so much.
best tutorials :)
Loved this thanks
everyone watch this video, he needs money to buy cough drops...
actually great video though :)
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
the arduino can't recognize Serial.readString but it recognize Serial.parseInt
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.
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.*
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.
great video
Why would you write serial.available == 0 for asking your name? wouldn't == 0 mean it is an integer and not a string?
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.
really great
Love from india
Thanks a lot!
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");
}
Oh sorry you corrected it
start (for me) @ 16 mins in.
Looks like he is hoarding tabs in chrome. Why would anyone need so many websites to be opened?
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
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.
Same shit, about 20 tabs opened...
💖💖💖💖💖💖💖💖
Are you PaulS
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.
Thanks
thank u sir
Can't listen past the cough man... Next video....
That is such an annoying cough
*clicks on video* Ahh, just one more like before he dies *immediately leaves video*