Vehicle Control Unit 0.01
This is the c library for controlling the car.
|
Go to the source code of this file.
Classes | |
struct | WheelSpeed |
Functions | |
void | initWheelSpeed (WheelSpeed *ws, int hz, int port, float radius, int numTeeth, WHEEL_LOCATION location) |
Initialization function for a wheel speed sensor. More... | |
float | calculateSpeed (WheelSpeed *ws) |
Translates data to speed in mph. More... | |
int | updateWheelSpeed (Updateable *updateable) |
Updated the speed var in this sensor. More... | |
void | setTimeInterval (WheelSpeed *ws, float interval) |
Set time interval. More... | |
void | addPulse (WheelSpeed *wf, int num) |
Add pulses to sensor;. More... | |
void addPulse | ( | WheelSpeed * | wf, |
int | num | ||
) |
Add pulses to sensor;.
ws | A pointer to the WheelSpeed structure. |
num | Number of pulses to add. |
Definition at line 76 of file WheelSpeed.c.
float calculateSpeed | ( | WheelSpeed * | ws | ) |
Translates data to speed in mph.
ws | A pointer to the WheelSpeed structure. |
Definition at line 25 of file WheelSpeed.c.
void initWheelSpeed | ( | WheelSpeed * | ws, |
int | hz, | ||
int | port, | ||
float | radius, | ||
int | numTeeth, | ||
WHEEL_LOCATION | location | ||
) |
Initialization function for a wheel speed sensor.
ws | A pointer to the WheelSpeed structure. @pram hz Rate at which the sensor is called (in hz). @pram port Location of sensor. @pram radius Radius of wheel (in mm). @pram numTeeth Number of teeth on reluctor wheel. @pram location Location of sensor on car. |
Definition at line 13 of file WheelSpeed.c.
void setTimeInterval | ( | WheelSpeed * | ws, |
float | interval | ||
) |
Set time interval.
ws | A pointer to the WheelSpeed structure. |
interval | Time interval to set. |
Definition at line 72 of file WheelSpeed.c.
int updateWheelSpeed | ( | Updateable * | updateable | ) |
Updated the speed var in this sensor.
updateable | A pointer to the updateable structure. |
Definition at line 58 of file WheelSpeed.c.