       if (IS_PIN_ANALOG(pin) && pinConfig[pin] == ANALOG) {
         analogPin = PIN_TO_ANALOG(pin);
         if (analogInputsToReport & (1 << analogPin)) {
-          BLE_Firmata.sendAnalog(analogPin, analogRead(analogPin));
+          int currentRead = analogRead(analogPin);
+          if ((lastAnalogReads[analogPin] == -1) || (lastAnalogReads[analogPin] != currentRead)) {
+            BLE_Firmata.sendAnalog(analogPin, currentRead);
+            lastAnalogReads[analogPin] = currentRead;
+          }
         }
       }
     }

    } else {
      portConfigInputs[pin/8] &= ~(1 << (pin & 7));
    }
    Serial.print(F("Setting pin #")); Serial.print(pin); Serial.print(F(" port config mask to = 0x")); 
    Serial.println(portConfigInputs[pin/8], HEX);
  }
  pinState[pin] = 0;
  switch(mode) {

        digitalWrite(PIN_TO_DIGITAL(pin), LOW); // disable internal pull-ups
      }
      pinConfig[pin] = ANALOG;
      lastAnalogReads[pin] = -1;
    }
    break;
  case INPUT:
