int analogPin = A0; int meas = 0; void setup() { Serial.begin(9600); // setup serial } void loop() { meas = analogRead(analogPin); // read the input pin if (Serial.available()) { if (Serial.read() == '1') { Serial.println(meas); // debug value } } }