Go to the source code of this file.
◆ getAppPosition()
float getAppPosition |
( |
App * |
app | ) |
|
Gets the current position of the APP.
- Parameters
-
app | Pointer to the App structure to query. |
- Returns
- The current position of the APP.
Definition at line 11 of file App.c.
◆ initApp()
void initApp |
( |
App * |
app, |
|
|
int |
hz, |
|
|
int |
channel |
|
) |
| |
Initializes the APP with the given frequency and channel.
- Parameters
-
app | Pointer to the App structure to initialize. |
hz | The frequency in Hertz at which the APP operates. |
channel | The analog channel the APP is connected to. |
Definition at line 5 of file App.c.
5 {
9}
void initAnalogSensor(AnalogSensor *analogSensor, const char *name, int hz, int channel)
Initializes an analog sensor and configures the corresponding GPIO pin.
void updateApp(void *app)
Updates the APP data.
void(* update)(void *self)
◆ setAppPos()
void setAppPos |
( |
App * |
app, |
|
|
float |
pos |
|
) |
| |
Sets pedal position in app sensor.
- Note
- For testing only
- Parameters
-
app | Pointer to app sensor. |
pos | Position to set on sensor. |
Definition at line 35 of file App.c.
◆ transferFunctionApp()
float transferFunctionApp |
( |
float |
rawVal | ) |
|
Converts raw APP data to a meaningful position value.
- Parameters
-
rawVal | The raw data from the APP. |
- Returns
- The converted APP position value.
Definition at line 22 of file App.c.
22 {
23
24 if (rawVal < 0.5) {
25 printf("App::transfer_function rawValue is too low\n");
26 return -1;
27 }
28 else if (rawVal > 4.5) {
29 printf("App::transfer_function rawValue is too high\n");
30 return -1;
31 }
32 return (22.5 * rawVal) - 56.25;
33}
◆ updateApp()
void updateApp |
( |
void * |
app | ) |
|
Updates the APP data.
- Parameters
-
app | Pointer to the App structure to update. |
Definition at line 15 of file App.c.
15 {
17
18 float rawData = 1.0f;
20}
float transferFunctionApp(float rawVal)
Converts raw APP data to a meaningful position value.