Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8942499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:31:56+00:00 2026-06-15T11:31:56+00:00

This program is meant to read an input, and write it out in the

  • 0

This program is meant to read an input, and write it out in the Arduino’s serial monitor. The issue that it only write one character in the serial monitor.

void setup()
{
Serial.begin(9600); //Set the serial monitor.
lcd.begin(16, 2); //Set the LCD
}
// Alignment variables
boolean left = true; //Set boolean left to true to begin to display text in middle of screen.
boolean right = false; //Other possible align booleans set to false
boolean select = false;
//Text show/hide variables
boolean show1 = true;  //Both values set to true to display on start up.
boolean show2 = true;
//Serial input
char serialinput [4] = {0}; //For 3 value input, and null character to end.
char line1;
void loop()
 {

 if (Serial.available() > 0) { //If the serial monitor is open it will read a value.
    line1 = Serial.read();
    Serial.print(line1);
    memmove (serialinput, &serialinput[1], 3); //copy the value to memory
    serialinput [2] = Serial.read(); //value is read.
    //if statements for each possible input.

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T11:31:57+00:00Added an answer on June 15, 2026 at 11:31 am

    Serial.read doesn’t wait for the end of a string. If you’re trying to read a few characters (implied by [4]) you only need to include a short delay() after serial.read to allow enough time for the buffer to completely dump the string.

    if (Serial.available() > 0) { //If the serial monitor is open it will read a value.
     line1 = Serial.read();
     delay(100);
     Serial.print(line1);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This program is meant to read in a csv file and create a dictionary
I have this small program that reads a line of input & prints the
This program is meant to generate a dynamic array, however it gives an access
This program builds a dictionary out of a list based on what two index
I'm trying to write a program to automate one of my more boring and
This code runs fine but the for statement by the meant to read back
First, let me point out that I read all the posts regarding database versioning,
For the program I'm working on, I frequently need to read input from a
I currently have an implementation of a program where I read in the input
I was writing a program that tell the user to input a random string,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.