 #include "Maxbotix.h"
 
 Maxbotix rangeSensorPW(8, Maxbotix::PW, Maxbotix::LV);
-Maxbotix rangeSensorTX(6, Maxbotix::TX, Maxbotix::LV);
+#ifdef MAXBOTIX_WITH_SOFTWARE_SERIAL
+  Maxbotix rangeSensorTX(6, Maxbotix::TX, Maxbotix::LV);
+#endif
 Maxbotix rangeSensorAD(A0, Maxbotix::AN, Maxbotix::LV);
 
 void setup()

  Serial.print("cm - ");
  Serial.print(millis() - start);
  Serial.println("ms");
  
  // AD
  start = millis();
  Serial.print("AD: ");

  Serial.print("cm - ");
  Serial.print(millis() - start);
  Serial.println("ms");
#ifdef MAXBOTIX_WITH_SOFTWARE_SERIAL
  // TX
  start = millis();
  Serial.print("TX: ");
