Vehicle Control Unit 0.01
This is the c library for controlling the car.
|
#include "../../../Inc/Sensors/DigitalSensors/WheelSpeed.h"
#include "../../../Inc/Utils/Conversions.h"
#include "../../../Inc/Utils/TimeUtils.h"
#include <stdio.h>
#include <math.h>
Go to the source code of this file.
Macros | |
#define | M_PI 3.14159265358979323846 |
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... | |
void | updateWheelSpeed (void *ws) |
Updated the speed var in this sensor. More... | |
void | setTimeInterval (WheelSpeed *ws, float interval) |
Set time interval. More... | |
void | addPulse (WheelSpeed *ws, int num) |
Add pulses to sensor;. More... | |
#define M_PI 3.14159265358979323846 |
Definition at line 9 of file WheelSpeed.c.
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 66 of file WheelSpeed.c.
float calculateSpeed | ( | WheelSpeed * | ws | ) |
Translates data to speed in mph.
ws | A pointer to the WheelSpeed structure. |
Definition at line 24 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 12 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 62 of file WheelSpeed.c.
void updateWheelSpeed | ( | void * | ws | ) |
Updated the speed var in this sensor.
ws | A pointer to the WheelSpeed structure. |
Definition at line 57 of file WheelSpeed.c.