// Master code int PO = A0; int A = 0; void setup() { // put your setup code here, to run once: Serial.begin(38400); } void loop() { // put your main code here, to run repeatedly: //communication int x=analogRead(PO); if (x==0){ A = 1 ; } if (x>400){ A = 2 ; } Serial.write (A); //send the value of A to the other chip Serial.print (A); Serial.print (" "); Serial.println(x); }