Vehicle Control Unit 0.01
This is the c library for controlling the car.
Loading...
Searching...
No Matches
ShockPot.h
Go to the documentation of this file.
1#ifndef RENSSELAERMOTORSPORT_SHOCKPOT_H
2#define RENSSELAERMOTORSPORT_SHOCKPOT_H
3
4#include "../AnalogSensor.h"
5#include "../../Utils/WheelLocation.h"
6
7typedef struct {
9 float distance;
11} ShockPot;
12
22void initShockPot(ShockPot* shockPot, int hz, int channel, WHEEL_LOCATION location);
23
30float getShockPotDistance(ShockPot* shockPot);
31
37void updateShockPot(void* shockPot);
38
45float transferFunctionShockPot(float rawVal);
46
47#endif // RENSSELAERMOTORSPORT_SHOCKPOT_H
void initShockPot(ShockPot *shockPot, int hz, int channel, WHEEL_LOCATION location)
Initializes the ShockPot sensor with the given frequency, channel, and wheel location.
Definition: ShockPot.c:6
float getShockPotDistance(ShockPot *shockPot)
Gets the current distance measured by the ShockPot.
Definition: ShockPot.c:13
void updateShockPot(void *shockPot)
Updates the ShockPot data.
Definition: ShockPot.c:17
float transferFunctionShockPot(float rawVal)
Converts raw ShockPot data to a meaningful distance value.
Definition: ShockPot.c:24
WHEEL_LOCATION
Definition: WheelLocation.h:4
float distance
Definition: ShockPot.h:9
AnalogSensor base
Definition: ShockPot.h:8
WHEEL_LOCATION wheel_location
Definition: ShockPot.h:10