Digital read Serial

This example is for Wiring version 0027+. If you have a previous version, use the examples included with your software. If you see any errors or have comments, please let us know.

AnalogReadSerial Reads an analog input pin 0 and prints the result to the serial monitor


void setup() {
  Serial.begin(9600);
}

void loop() {
  int sensorValue = analogRead(0);
  Serial.println(sensorValue, DEC);
  delay(100);
}