Remarks

MaxBotix
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Distance.MaxBotix

Code Example




Sample project(s) available on GitHub

Wiring Example

To wire a MaxBotix to your Meadow board, connect the following:

MaxBotix Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3
Characteristic Locus
Inheritance object ObservableBase<Length> SamplingSensorBase<Length> PollingSensorBase<Length> ByteCommsSensorBase<Length> > MaxBotix
Implements IObservable<IChangeResult<Length>> IRangeFinder ISamplingSensor<Length> ISensor<Length> IDisposable II2cPeripheral
Inherited Members ByteCommsSensorBase<Length>.BusComms ByteCommsSensorBase<Length>.ReadBuffer ByteCommsSensorBase<Length>.WriteBuffer ByteCommsSensorBase<Length>.Init(int, int) SamplingSensorBase<Length>.samplingLock SamplingSensorBase<Length>.Updated SamplingSensorBase<Length>.SamplingTokenSource SamplingSensorBase<Length>.Conditions SamplingSensorBase<Length>.IsSampling SamplingSensorBase<Length>.UpdateInterval SamplingSensorBase<Length>.Read() ObservableBase<Length>.observers ObservableBase<Length>.NotifyObservers(IChangeResult<Length>) ObservableBase<Length>.Subscribe(IObserver<IChangeResult<Length>>) ObservableBase<Length>.CreateObserver(Action<IChangeResult<Length>>, Predicate<IChangeResult<Length>>) object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString()
Namespace Meadow.Foundation.Sensors.Distance
Assembly MaxBotix.dll

Syntax

public class MaxBotix : ByteCommsSensorBase<Length>, IObservable<IChangeResult<Length>>, IRangeFinder, ISamplingSensor<Length>, ISensor<Length>, IDisposable, II2cPeripheral

Constructors

MaxBotix(SensorType, IPin, int, TimeSpan?, Voltage?)

Creates a new MaxBotix object communicating over analog

Declaration
public MaxBotix(MaxBotix.SensorType sensor, IPin analogInputPin, int sampleCount = 5, TimeSpan? sampleInterval = null, Voltage? voltage = null)

Parameters

Type Name Description
MaxBotix.SensorType sensor

The distance sensor type

IPin analogInputPin

The analog input pin

int sampleCount

The sample count for reading

TimeSpan? sampleInterval

The sample interval

Voltage? voltage

The reference voltage

Remarks

MaxBotix
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Distance.MaxBotix

Code Example




Sample project(s) available on GitHub

Wiring Example

To wire a MaxBotix to your Meadow board, connect the following:

MaxBotix Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3

MaxBotix(IAnalogInputPort, SensorType)

Creates a new MaxBotix object communicating over analog

Declaration
public MaxBotix(IAnalogInputPort analogInputPort, MaxBotix.SensorType sensor)

Parameters

Type Name Description
IAnalogInputPort analogInputPort

The port for the analog input pin

MaxBotix.SensorType sensor

The distance sensor type

Remarks

MaxBotix
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Distance.MaxBotix

Code Example




Sample project(s) available on GitHub

Wiring Example

To wire a MaxBotix to your Meadow board, connect the following:

MaxBotix Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3

MaxBotix(II2cBus, SensorType, byte)

Creates a new MaxBotix object communicating over I2C

Declaration
public MaxBotix(II2cBus i2cBus, MaxBotix.SensorType sensor, byte address = 112)

Parameters

Type Name Description
II2cBus i2cBus

The I2C bus

MaxBotix.SensorType sensor

The distance sensor type

byte address

The I2C address

Remarks

MaxBotix
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Distance.MaxBotix

Code Example




Sample project(s) available on GitHub

Wiring Example

To wire a MaxBotix to your Meadow board, connect the following:

MaxBotix Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3

MaxBotix(ISerialMessagePort, SensorType)

Creates a new MaxBotix object communicating over serial

Declaration
public MaxBotix(ISerialMessagePort serialMessage, MaxBotix.SensorType sensor)

Parameters

Type Name Description
ISerialMessagePort serialMessage

The serial message port

MaxBotix.SensorType sensor

The distance sensor type

Remarks

MaxBotix
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Distance.MaxBotix

Code Example




Sample project(s) available on GitHub

Wiring Example

To wire a MaxBotix to your Meadow board, connect the following:

MaxBotix Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3

MaxBotix(IMeadowDevice, SerialPortName, SensorType)

Creates a new MaxBotix object communicating over serial

Declaration
public MaxBotix(IMeadowDevice device, SerialPortName serialPortName, MaxBotix.SensorType sensor)

Parameters

Type Name Description
IMeadowDevice device

The device connected to the sensor

SerialPortName serialPortName

The serial port name

MaxBotix.SensorType sensor

The MaxBotix distance sensor type

Remarks

MaxBotix
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Distance.MaxBotix

Code Example




Sample project(s) available on GitHub

Wiring Example

To wire a MaxBotix to your Meadow board, connect the following:

MaxBotix Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3

Properties

DefaultI2cAddress

The default I2C address for the peripheral

Declaration
public byte DefaultI2cAddress { get; }

Property Value

Type Description
byte

Remarks

MaxBotix
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Distance.MaxBotix

Code Example




Sample project(s) available on GitHub

Wiring Example

To wire a MaxBotix to your Meadow board, connect the following:

MaxBotix Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3

Distance

Distance from sensor to object

Declaration
public Length? Distance { get; protected set; }

Property Value

Type Description
Length?

Remarks

MaxBotix
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Distance.MaxBotix

Code Example




Sample project(s) available on GitHub

Wiring Example

To wire a MaxBotix to your Meadow board, connect the following:

MaxBotix Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3

IsDisposed

Is the object disposed

Declaration
public bool IsDisposed { get; }

Property Value

Type Description
bool

Remarks

MaxBotix
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Distance.MaxBotix

Code Example




Sample project(s) available on GitHub

Wiring Example

To wire a MaxBotix to your Meadow board, connect the following:

MaxBotix Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3

VCC

voltage common collector (VCC) typically 3.3V

Declaration
public double VCC { get; set; }

Property Value

Type Description
double

Remarks

MaxBotix
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Distance.MaxBotix

Code Example




Sample project(s) available on GitHub

Wiring Example

To wire a MaxBotix to your Meadow board, connect the following:

MaxBotix Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
public override void Dispose()

Overrides

Remarks

MaxBotix
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Distance.MaxBotix

Code Example




Sample project(s) available on GitHub

Wiring Example

To wire a MaxBotix to your Meadow board, connect the following:

MaxBotix Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3

Dispose(bool)

Dispose of the object

Declaration
protected override void Dispose(bool disposing)

Parameters

Type Name Description
bool disposing

Is disposing

Overrides

Remarks

MaxBotix
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Distance.MaxBotix

Code Example




Sample project(s) available on GitHub

Wiring Example

To wire a MaxBotix to your Meadow board, connect the following:

MaxBotix Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3

MeasureDistance()

Start a distance measurement

Declaration
public void MeasureDistance()

Remarks

MaxBotix
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Distance.MaxBotix

Code Example




Sample project(s) available on GitHub

Wiring Example

To wire a MaxBotix to your Meadow board, connect the following:

MaxBotix Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3

RaiseEventsAndNotify(IChangeResult<Length>)

Raise distance change event for subscribers

Declaration
protected override void RaiseEventsAndNotify(IChangeResult<Length> changeResult)

Parameters

Type Name Description
IChangeResult<Length> changeResult

Overrides

Remarks

MaxBotix
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Distance.MaxBotix

Code Example




Sample project(s) available on GitHub

Wiring Example

To wire a MaxBotix to your Meadow board, connect the following:

MaxBotix Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3

ReadSensor()

Read the distance from the sensor

Declaration
protected override Task<Length> ReadSensor()

Returns

Type Description
Task<Length>

Overrides

Remarks

MaxBotix
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Distance.MaxBotix

Code Example




Sample project(s) available on GitHub

Wiring Example

To wire a MaxBotix to your Meadow board, connect the following:

MaxBotix Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3

Exceptions

Type Condition
NotImplementedException

StartUpdating(TimeSpan?)

Start updating distances

Declaration
public override void StartUpdating(TimeSpan? updateInterval)

Parameters

Type Name Description
TimeSpan? updateInterval

Overrides

Remarks

MaxBotix
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Distance.MaxBotix

Code Example




Sample project(s) available on GitHub

Wiring Example

To wire a MaxBotix to your Meadow board, connect the following:

MaxBotix Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3

StopUpdating()

Stop sampling

Declaration
public override void StopUpdating()

Overrides

Remarks

MaxBotix
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Distance.MaxBotix

Code Example




Sample project(s) available on GitHub

Wiring Example

To wire a MaxBotix to your Meadow board, connect the following:

MaxBotix Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3

Events

DistanceUpdated

Raised when the value of the reading changes

Declaration
public event EventHandler<IChangeResult<Length>> DistanceUpdated

Event Type

Type Description
EventHandler<IChangeResult<Length>>

Remarks

MaxBotix
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Distance.MaxBotix

Code Example




Sample project(s) available on GitHub

Wiring Example

To wire a MaxBotix to your Meadow board, connect the following:

MaxBotix Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3