Arduino: Reading Number Input from the Serial Monitor

preview_player
Показать описание
Sending numeric values from Arduinos' Serial Monitor to the Arduino board can be tricky. In this video I explain the problem, and demonstrate some basic ways of solving it.

And if you want to send floating-point numbers:

Check out my Blog:

And facebook page:
Рекомендации по теме
Комментарии
Автор

Jesus Christ ! I was stuck on this problem for 2 weeks until the YouTube algorithm recommended this ! Thanks a ton !!!

pranav_manoj
Автор

Thanks man you saved my day. I was struggling to send data between nodemcu and arduino, searched a lot and finally ended here. Thank you

kishoreksm
Автор

Oh my goodness, this may actually give me considerable progress with my program. Thanks a lot, man!

Jensettiman
Автор

Totally brilliant. Explained it all in 5 mins! I’d been trying to turn numbers into strings. Without success, of course. Thanks

MrDeanBright
Автор

i'm new to all this but even i can recognize the value of what your are sharing ..thank you very much for taking the time and explaining it to us all.. Hope you are doing well.

samdeur
Автор

Straight to the point, no BS. Do more vids.

Exo
Автор

Thank you! Very informative to sneak up on the final solution.got the answer plus some knowledge.😀

jetmech
Автор

This is what i was exactly looking for thanks a lot!

burhanc
Автор

Dude this was the one piece that stopped my programm from working. Thx

NoWayOut
Автор

Thank you sir! Your tutorial really helps..

ferdinandmarquita
Автор

Thank you so much! Really helped with my project!

cooperkeenan
Автор

Really appreciate your time and effort! Thanks!

tbrandx
Автор

Excellent explanation! Thank you so much!!

YaseminTheBest
Автор

Awesome tutorial for taking input from Serial monitor.

rajanitadas
Автор

Great information. Simple but very useful. Like it dude :thumbs up for you

banusudewa
Автор

This kind of video very rare explaining serial port underhood about pc to arduino

hfe
Автор

I need to find a way to capture the oscillation point of a moving object.
To visualize this, Picture a rail with a distance sensor at each end. The target would oscillate between the 2 end points with the center being 180. To the left the max measurement would be 270 and max 90 to the right. When the target moves to the right then switches direction I want to capture the farthest measurement lowest number serial data to trigger a device when the target is at a certain point on the left. Then I want to capture the oscillation point highest number on the left to in turn trigger the device at a certain point on the right. Due to changing loads on the device being triggered the oscillation points will change randomly.

Can this be done?

Below is a rough draft of comments without any code.

//Arduino uno

// vl53l0x sensors
// distance sensor1 value 181 to 270 degrees
//distance sensor2 value 179 to 90 degrees


//1 stepper Nemo 17 or 23
//Stepper full rotation 0-359 steps (clock wise count 0 north)
//Home 180, max rotation from 270 to 90 degrees.
// orientations. 270 right, 90 left.
//sensors placed at the ends of a rail with oscillating target.

//if sensor1 value oscillates set sensor1 to highvalue of oscillation
Oscillation at 172-173-172 would set value at 173

// if sensor2 lowalue is = 178
// run stepper to 183 when sensor1 reaches 182 //1degrees
// if sensor2 lowalue is =177
// run stepper to 184 when sensor1 reaches 183
// if sensor2 lowalue is =176
// run stepper to 185 when sensor1 reaches 184
// if sensor2 lowalue is = 175
// run stepper to 186 when sensor1 reaches 185
// if sensor2 lowalue is =174
// run stepper to 187 when sensor1 reaches 186
// if sensor2 lowalue is =173
// run stepper to 188 when sensor1 reaches 187
// if sensor2 lowalue is = 172
// run stepper to 189 when sensor1 reaches 188
// if sensor2 lowalue is =171
// run stepper to 189 when sensor1 reaches 188
to lowvalue of 90
//use < at end max run to 270

//If sensor 2 value oscillates set sensor2 to lowvalue of oscillation
Ocilation at 186 - 185 - 186 would set value at 185

// if sensor1 highvalue is 182
// run stepper to 177 when sensor2 reaches 178
// if sensor1 highvalue is 183
// run stepper to 176 when sensor2 reaches 177
// if sensor1 highvalue is 184
// run stepper to 175 when sensor2 reaches 176
// if sensor1 highvalue is 185
// run stepper to 174 when sensor2 reaches 175
highvalue of
//use > at end max run to 90.

jameselliott
Автор

Thank you! Your video is very helpful! But when I was doing a loop, sometimes "Serial.parseInt" came out the right number I put, like 1300. But sometimes it doesn't work with the number like 1000. Do you know any reasons? Regards,

xiaoyingwu
Автор

Thank you so much for your sharing! However, can I use Serial.parseInt if I would like to key the inputs twice? As in I need to let the users to key in two inputs. Appreciate if you could advise me on this, thank you so much!

shongjianfong
Автор

VERY good. Thank you : ) Just subscribed..

drakkorvladimir