1#include "../../../Inc/Sensors/AnalogSensors/ShockPot.h"
19 printf(
"Implement ShockPot::update\n");
26 printf(
"ShockPot::transfer_function rawValue is too low\n");
29 else if (rawVal > 135) {
30 printf(
"ShockPot::transfer_function rawValue is too high\n");
33 return 2.71965 * pow(rawVal, 0.837683) - 16.2622;
void initAnalogSensor(AnalogSensor *analogSensor, const char *name, int hz, int channel)
Initializes an analog sensor and configures the corresponding GPIO pin.
void initShockPot(ShockPot *shockPot, int hz, int channel, WHEEL_LOCATION location)
Initializes the ShockPot sensor with the given frequency, channel, and wheel location.
float getShockPotDistance(ShockPot *shockPot)
Gets the current distance measured by the ShockPot.
void updateShockPot(void *shockPot)
Updates the ShockPot data.
float transferFunctionShockPot(float rawVal)
Converts raw ShockPot data to a meaningful distance value.
WHEEL_LOCATION wheel_location
void(* update)(void *self)