MatrixMiniR4 1.2.2
Matrix Mini R4 Arduino Library API Documentation
Loading...
Searching...
No Matches
MatrixLineTracer Class Reference

A class for MATRIX Line Tracer 10CH sensor. More...

#include <MiniR4_MXLineTracer.h>

Public Member Functions

void begin ()
 Initialize the LineTracer sensor.
 
bool getAllSensors (uint8_t data[10])
 Get All sensor value into array.
 
uint8_t getSensor (uint8_t n)
 Get single sensor value.
 
String getVersion ()
 Get sensor firmware version.
 
uint8_t getLineWidth ()
 Get Line Width.
 
float getError ()
 Get Error (Weights based).
 
bool isOnline ()
 Is Sensor still online?
 
uint8_t getLastSensor ()
 Get last sensor online before robot go offline.
 
uint8_t getJunctionType ()
 Get Junction Type.
 
void setWeights (float w1, float w2, float w3, float w4, float w5, float w6, float w7, float w8, float w9, float w10)
 Set Weights for error calc.
 
void setThreshold (uint8_t threshold)
 Set threshold for error calc.
 
void startCalibration ()
 Start Calibration Mode.
 
void endCalibration ()
 End Calibration Mode.
 

Public Attributes

uint8_t _ch = 0
 I2C multiplexer channel.
 
TwoWire * _pWire
 Pointer to Wire object.
 

Detailed Description

A class for MATRIX Line Tracer 10CH sensor.

Definition at line 27 of file MiniR4_MXLineTracer.h.

Member Function Documentation

◆ begin()

void MatrixLineTracer::begin ( )

Initialize the LineTracer sensor.

Definition at line 12 of file MiniR4_MXLineTracer.cpp.

◆ endCalibration()

void MatrixLineTracer::endCalibration ( )

End Calibration Mode.

Definition at line 142 of file MiniR4_MXLineTracer.cpp.

◆ getAllSensors()

bool MatrixLineTracer::getAllSensors ( uint8_t data[10])

Get All sensor value into array.

Parameters
dataThe array need to storage value.

Definition at line 42 of file MiniR4_MXLineTracer.cpp.

◆ getError()

float MatrixLineTracer::getError ( )

Get Error (Weights based).

Returns
Error value (Default: -4.5 ~ 4.5).

Definition at line 82 of file MiniR4_MXLineTracer.cpp.

◆ getJunctionType()

uint8_t MatrixLineTracer::getJunctionType ( )

Get Junction Type.

Returns
0 = None, 1 = Left, 2 = Right, 3 = T or Cross, 4 = Unknown/None

Definition at line 113 of file MiniR4_MXLineTracer.cpp.

◆ getLastSensor()

uint8_t MatrixLineTracer::getLastSensor ( )

Get last sensor online before robot go offline.

Returns
Sensor ID (1~10).

Definition at line 109 of file MiniR4_MXLineTracer.cpp.

◆ getLineWidth()

uint8_t MatrixLineTracer::getLineWidth ( )

Get Line Width.

Returns
How many sensor online (1~10).

Definition at line 74 of file MiniR4_MXLineTracer.cpp.

◆ getSensor()

uint8_t MatrixLineTracer::getSensor ( uint8_t n)

Get single sensor value.

Parameters
nSensor ID (1~10).
Returns
Light value.

Definition at line 57 of file MiniR4_MXLineTracer.cpp.

◆ getVersion()

String MatrixLineTracer::getVersion ( )

Get sensor firmware version.

Returns
Version String.

Definition at line 63 of file MiniR4_MXLineTracer.cpp.

◆ isOnline()

bool MatrixLineTracer::isOnline ( )

Is Sensor still online?

Returns
True or False.

Definition at line 104 of file MiniR4_MXLineTracer.cpp.

◆ setThreshold()

void MatrixLineTracer::setThreshold ( uint8_t threshold)

Set threshold for error calc.

Parameters
thresholdThreshold for line.

Definition at line 131 of file MiniR4_MXLineTracer.cpp.

◆ setWeights()

void MatrixLineTracer::setWeights ( float w1,
float w2,
float w3,
float w4,
float w5,
float w6,
float w7,
float w8,
float w9,
float w10 )

Set Weights for error calc.

Parameters
w1weights for S1
w2weights for S2
w3weights for S3
w4weights for S4
w5weights for S5
w6weights for S6
w7weights for S7
w8weights for S8
w9weights for S9
w10weights for S10

Definition at line 117 of file MiniR4_MXLineTracer.cpp.

◆ startCalibration()

void MatrixLineTracer::startCalibration ( )

Start Calibration Mode.

Definition at line 135 of file MiniR4_MXLineTracer.cpp.

Member Data Documentation

◆ _ch

uint8_t MatrixLineTracer::_ch = 0

I2C multiplexer channel.

Definition at line 37 of file MiniR4_MXLineTracer.h.

◆ _pWire

TwoWire* MatrixLineTracer::_pWire

Pointer to Wire object.

Definition at line 38 of file MiniR4_MXLineTracer.h.


The documentation for this class was generated from the following files: