// ==========================================================================
// Maxbotix HRXL Ultrasonic Range Finder
// ==========================================================================
/** Start [maxbotics] */
#include <sensors/MaxBotixSonar.h>
// A Maxbotix sonar with the trigger pin disconnect CANNOT share the serial port
// A Maxbotix sonar using the trigger may be able to share but YMMV
// NOTE: Extra hardware and software serial ports are created in the "Settings
// for Additional Serial Ports" section
const int8_t SonarPower = sensorPowerPin; // Excite (power) pin (-1 if unconnected)
const int8_t Sonar1Trigger = -1; // Trigger pin (a unique negative number if unconnected)
const uint8_t sonar1NumberReadings = 3; // The number of readings to average
// Create a MaxBotix Sonar sensor object
MaxBotixSonar sonar1(sonarSerial, SonarPower, Sonar1Trigger, sonar1NumberReadings);