Esp32-Mcp3008-LineSensor
Library for Espressiff ESP32 based line followers, using the MCP3008 ADC chip.
Public Member Functions | Friends | List of all members
mcp3008::LineSensorCalibrator Class Reference

This class represents a single sensor calibration session. More...

#include <mcp3008_linesensor.h>

Public Member Functions

 ~LineSensorCalibrator ()
 
void reset ()
 Reset this calibrator to the initial state. More...
 
esp_err_t record ()
 Record current sensor values. More...
 
void save ()
 Store the calibrated values to the parent LineSensor. More...
 

Friends

class LineSensor
 

Detailed Description

This class represents a single sensor calibration session.

Typical calibration session consists of moving the sensors over the line while calling the record() method over and over, and then storing the data to the LineSensor instance via the save() method.

The parent LineSensor is modified only by the save() method. This calibrator can be reused multiple times by calling the reset() method between each session.

Instances of this class are created via LineSensor's startCalibration(). It must not outlive the parent LineSensor object.

Constructor & Destructor Documentation

◆ ~LineSensorCalibrator()

mcp3008::LineSensorCalibrator::~LineSensorCalibrator ( )

Member Function Documentation

◆ record()

esp_err_t mcp3008::LineSensorCalibrator::record ( )

Record current sensor values.

Call this repeatedly while moving the sensors over the line.

Returns
potential error returned by LineSensor's read()

◆ reset()

void mcp3008::LineSensorCalibrator::reset ( )

Reset this calibrator to the initial state.

◆ save()

void mcp3008::LineSensorCalibrator::save ( )

Store the calibrated values to the parent LineSensor.

Friends And Related Function Documentation

◆ LineSensor

friend class LineSensor
friend

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