Vehicle Control Unit
0.01
This is the c library for controlling the car.
Loading...
Searching...
No Matches
Core
Inc
Sensors
AnalogSensors
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
7
typedef
struct
{
8
AnalogSensor
base
;
9
float
distance
;
10
WHEEL_LOCATION
wheel_location
;
11
}
ShockPot
;
12
22
void
initShockPot
(
ShockPot
* shockPot,
int
hz,
int
channel,
WHEEL_LOCATION
location);
23
30
float
getShockPotDistance
(
ShockPot
* shockPot);
31
37
void
updateShockPot
(
void
* shockPot);
38
45
float
transferFunctionShockPot
(
float
rawVal);
46
47
#endif
// RENSSELAERMOTORSPORT_SHOCKPOT_H
initShockPot
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
getShockPotDistance
float getShockPotDistance(ShockPot *shockPot)
Gets the current distance measured by the ShockPot.
Definition:
ShockPot.c:13
updateShockPot
void updateShockPot(void *shockPot)
Updates the ShockPot data.
Definition:
ShockPot.c:17
transferFunctionShockPot
float transferFunctionShockPot(float rawVal)
Converts raw ShockPot data to a meaningful distance value.
Definition:
ShockPot.c:24
WHEEL_LOCATION
WHEEL_LOCATION
Definition:
WheelLocation.h:4
AnalogSensor
Definition:
AnalogSensor.h:27
ShockPot
Definition:
ShockPot.h:7
ShockPot::distance
float distance
Definition:
ShockPot.h:9
ShockPot::base
AnalogSensor base
Definition:
ShockPot.h:8
ShockPot::wheel_location
WHEEL_LOCATION wheel_location
Definition:
ShockPot.h:10
Generated by
1.9.5