Arduino Serial Print

Introduction: Arduino Serial Print

Arduino serial print is used to read sensor data and display it on the human-readable format. Let understand this using an example. Suppose you have a humidity sensor and you want to know the amount of moisture present in the air. Either Arduino nor sensor have any display so their serial print come in the role.

Supplies

Arduino

USB cable

computer

Arduino IDE

Step 1: Example Code

There is an example code in Arduino ide you can copy and upload the following code.

or navigate to file>example>basics>serialReadbasics

------------------------------------------------------------------------------------------------------------

// the setup routine runs once when you press reset:
void setup() { // initialize serial communication at 9600 bits per second: Serial.begin(9600); }

// the loop routine runs over and over again forever: void loop() { // read the input on analog pin 0: int sensorValue = analogRead(A0); // print out the value you read: Serial.println(sensorValue); delay(1); // delay in between reads for stability }

-------------------------------------------------------------------------------------------------------------------

Step 2:

Check this post for detailed explanation

Arduino serial print:- to display output of sensors

Be the First to Share

    Recommendations

    • Retro Tech Challenge

      Retro Tech Challenge
    • Back to School: Student Design Challenge

      Back to School: Student Design Challenge
    • Rocks, Gems, and Stones Speed Challenge

      Rocks, Gems, and Stones Speed Challenge

    Comments