Skip to content

An Adruino library to interfacing with the Maxbotix series of lookdown ultrasonic rangefinders, specifically designed for use as environmental sensors

License

Notifications You must be signed in to change notification settings

NorthernWidget/MaxBotix_Library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Summary

Members Descriptions
class Maxbotix Arduino library to enable control and communication with MaxBotix ultrasonic rangefinders using a software serial implementation.

class Maxbotix

Arduino library to enable control and communication with MaxBotix ultrasonic rangefinders using a software serial implementation.

This Arduino library will enable the microcontroller to control and read output from a MaxBotix ultrasonic rangefinder. It works using software serial, and is not programmed to interface wtih the pulse-width or analog-voltage outputs of the Maxbotix rangefinder. It can average multiple measurements to obtain a more robust distance to its target.

  • DOI

Summary

Members Descriptions
public Maxbotix(uint8_t DataPin)
public bool begin(uint8_t _nPings,bool _writeAll,uint8_t _ExPin) Sets globals and initializes software serial.
public int16_t getRange() Returns the result of a single range measurement now set for multiple?
public String getHeader() Creates the appropritae header for the data file.
public String getString() Returns the measurement result(s) as a String object.
public int16_t GetRange() CapitalCase version of getRange() for backwards compatibility.
public String GetHeader() CapitalCase version of getHeader() for backwards compatibility.
public String GetString() CapitalCase version of getString() for backwards compatibility.

Members

public Maxbotix(uint8_t DataPin)

public bool begin(uint8_t _nPings,bool _writeAll,uint8_t _ExPin)

Sets globals and initializes software serial.

Sets global variables required for a SoftwareSerial interface to record data from a MaxBotix ultrasonic rangefinder. Initializes software serial based on _RxPin.

Parameters

  • _RxPin Pin for SoftwareSerial receive at 9600 bps.

  • _npings Number of pings over which you average; each ping itself includes ten short readings that the sensor internally processes. Must be > 0, obviously, and <= 255. Defaults to "1"

  • _writeAll will write each reading of the sensor (each ping) to the serial monitor and SD card. This is relevant only if npings > 1

  • _ExPin Excitation pin that turns the sensor on; defaults to "-1", assuming that the sensor is either always on or is being switched via its main power supply.

  • _RS232 defaults false for standard (TTL) logic; true for inverse (RS232-style) logic. It works at standard logger voltages: this is not true RS232, but this is what MaxBotix calls it.

  • _minRange_mm Minimum sensor range in mm; defaults to 501

  • _maxRange_mm Maximum sensor range in mm; defaults to 4999

Example:

// SoftwareSerial with RxPin 7, averaging over 10 pings, and otherwise
// using default settings
alog.maxbotixHRXL_WR_Serial(7, 10);

public int16_t getRange()

Returns the result of a single range measurement now set for multiple?

Returns the result of a single range measurement. Communications error value = -9999 Internal error value (including range too long) = 5000 Range too short error value = 500 This code makes these internal error values negative to more easily sort them out of the real results

public String getHeader()

Creates the appropritae header for the data file.

Creates the appropritae header for the data file, based on provided inputs (number of pings, recording all pings)

public String getString()

Returns the measurement result(s) as a String object.

Returns the measurement result(s) as a String object

public int16_t GetRange()

CapitalCase version of getRange() for backwards compatibility.

public String GetHeader()

CapitalCase version of getHeader() for backwards compatibility.

public String GetString()

CapitalCase version of getString() for backwards compatibility.

Generated by Moxygen

About

An Adruino library to interfacing with the Maxbotix series of lookdown ultrasonic rangefinders, specifically designed for use as environmental sensors

Resources

License

Stars

Watchers

Forks

Packages