In this Quick tutorial we will look into how can we read user input strings from the Arduino Serial Monitor or other serial terminals. Quick steps.
serial_buffer_len
which will be max user input you are expecting.Serial.available()
.read_serial_input()
function to load the serial_buffer
.After uploading the sample code open serial monitor and input something like hello world and then you will see it printed in the serial monitor. This is very useful code snippet incase you want to input strings from user and want to perform actions on it.