Vehicle Control Unit 0.01
This is the c library for controlling the car.
Loading...
Searching...
No Matches
WheelSpeed.h
Go to the documentation of this file.
1#ifndef RENSSELAERMOTORSPORT_WHEELSPEED_H
2#define RENSSELAERMOTORSPORT_WHEELSPEED_H
3
4#include "../DigitalSensor.h"
5#include "../../Utils/WheelLocation.h"
6
7typedef struct {
10 float speed;
11 float radius;
12 float interval;
14 int pulses;
16
27void initWheelSpeed(WheelSpeed* ws, int hz, int port, float radius, int numTeeth,
28 WHEEL_LOCATION location);
35float calculateSpeed(WheelSpeed* ws);
36
42void updateWheelSpeed(void* ws);
43
51void setTimeInterval(WheelSpeed* ws, float interval);
52
60void addPulse(WheelSpeed* wf, int num);
61
62#endif // RENSSELAERMOTORSPORT_WHEELSPEED_H
WHEEL_LOCATION
Definition: WheelLocation.h:4
void addPulse(WheelSpeed *wf, int num)
Add pulses to sensor;.
Definition: WheelSpeed.c:66
void setTimeInterval(WheelSpeed *ws, float interval)
Set time interval.
Definition: WheelSpeed.c:62
void updateWheelSpeed(void *ws)
Updated the speed var in this sensor.
Definition: WheelSpeed.c:57
float calculateSpeed(WheelSpeed *ws)
Translates data to speed in mph.
Definition: WheelSpeed.c:24
void initWheelSpeed(WheelSpeed *ws, int hz, int port, float radius, int numTeeth, WHEEL_LOCATION location)
Initialization function for a wheel speed sensor.
Definition: WheelSpeed.c:12
WHEEL_LOCATION wheel_location
Definition: WheelSpeed.h:9
float interval
Definition: WheelSpeed.h:12
float speed
Definition: WheelSpeed.h:10
int pulses
Definition: WheelSpeed.h:14
float radius
Definition: WheelSpeed.h:11
DigitalSensor base
Definition: WheelSpeed.h:8
int numTeeth
Definition: WheelSpeed.h:13