int analogPin = A0; //setaroume tin analogiki porta A0 tou arduino 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 } } }