//This code written by Deepankar Maithani int pot = A0; // Connect the middle pin of pot to this pin int pot2 = A1; int pot3 = A2; int pot4 = A3; int lectura1;// variable for storing the pot values; int lectura2; int lectura3; int lectura4; void setup() { //initialize serial communications at a 9600 baud rate Serial.begin(9600); } void loop() { String s = ""; //Llegir sensor1 lectura1 = analogRead(pot); // lectura the analog value if (lectura1 > 100) { s = "1"; delay(100); } else { s = "0"; delay(100); } //Llegir sensor2 lectura2 = analogRead(pot2); // lectura the analog value if (lectura2 > 100) { s = s + "1"; } else { s = s + "0"; delay(100); } //Llegir sensor3 lectura3 = analogRead(pot3); // lectura the analog value if (lectura3 > 100) { s = s + "1"; } else { s = s + "0"; delay(100); } //Llegir sensor4 lectura4 = analogRead(pot4); // lectura the analog value if (lectura4 > 100) { s = s + "1"; } else { s = s + "0"; delay(100); } Serial.println(s); }