 }
 
 void sendid() {
-    if (!digitalRead(A0)) {
-        Serial.write(sReady + 0);
-    } else if (!digitalRead(A1)) {
-        Serial.write(sReady + 1);
-    } else if (!digitalRead(A2)) {
-        Serial.write(sReady + 2);
-    } else if (!digitalRead(A3)) {
-        Serial.write(sReady + 3);
-    }
+    byte id = digitalRead(idmsbPin) << digitalRead(idlsbPin);
+    Serial.write(sReady + id);
 }
 
 int pitchToPulse(float pitch) {

    receivedata();
    if (newData) processdata();
    */
    blink();
    durationturn(2000, 60, true, false);
    delay(1000);
    durationturn(2000, 67, true, false);

    pinMode(enablePin, OUTPUT);
    pinMode(alarmPin, INPUT_PULLUP);
    pinMode(sensorPin, INPUT_PULLUP);
    pinMode(idmsbPin, INPUT_PULLUP);
    pinMode(idlsbPin, INPUT_PULLUP);
    digitalWrite(dirPin, HIGH);
    digitalWrite(enablePin, LOW);
    Serial.begin(38400);
    findsensor(maxPulse);
    defaults();
    sendid();
}

void defaults() {
