int Sensor1 = 0; // first analog sensor int Sensor2 = 0; // second analog sensor int Sensor3 = 0; // third analog sensor int Sensor4 = 0; // fourth analog sensor int Sensor5 = 0; // fifth analog sensor int Sensor6 = 0; // sixth analog sensor int inByte = 0; // incoming serial byte String Sensors = ""; //return sensor string void setup() { // start serial port at 9600 bps: Serial.begin(9600); } String makeHex(int x){ String holdS = String(x,HEX); if (holdS.length() == 1) { holdS = "00" + holdS; } else if (holdS.length() == 2) { holdS = "0" + holdS; } return holdS; } void loop() { // if we get a valid byte, read analog ins: if (Serial.available() > 0) { // get incoming byte: inByte = Serial.read(); // read analog input: Sensor1 = analogRead(A0); Sensor2 = analogRead(A1); Sensor3 = analogRead(A2); Sensor4 = analogRead(A3); Sensor5 = analogRead(A4); Sensor6 = analogRead(A5); // combine sensor hex values Sensors = String(makeHex(Sensor1) + makeHex(Sensor2) + makeHex(Sensor3) + makeHex(Sensor4) + makeHex(Sensor5) + makeHex(Sensor6)); // send sensor values: Serial.print(Sensors); } }