Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
tap::communication::sensors::current::AnalogCurrentSensor Class Reference

#include <analog_current_sensor.hpp>

Inheritance diagram for tap::communication::sensors::current::AnalogCurrentSensor:
Collaboration diagram for tap::communication::sensors::current::AnalogCurrentSensor:

Classes

struct  Config
 

Public Member Functions

 AnalogCurrentSensor (const Config &config)
 
float getCurrentMa () const override
 
void update () override
 

Detailed Description

Linear analog current sensor that reads current from a sensor attached to an analog pin, applying a moving average to data read each time getCurrentMa is called. As such, for optimal performance, call getCurrentMa() periodically at some consistent rate.

Constructor & Destructor Documentation

◆ AnalogCurrentSensor()

tap::communication::sensors::current::AnalogCurrentSensor::AnalogCurrentSensor ( const Config config)

Member Function Documentation

◆ getCurrentMa()

float tap::communication::sensors::current::AnalogCurrentSensor::getCurrentMa ( ) const
overridevirtual
Returns
The current read by the current sensor, in milliamps.

Implements tap::communication::sensors::current::CurrentSensorInterface.

◆ update()

void tap::communication::sensors::current::AnalogCurrentSensor::update ( )
overridevirtual

Function that one implements that reads data from the sensor and performs any filtering as required.

Implements tap::communication::sensors::SensorInterface.


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