Declares functions for operating valve.
More...
#include <project.h>
#include "misc.h"
Go to the source code of this file.
|
| int | move_valve (int valve) |
| | Move valve to the position indicated by valve. More...
|
| |
| int | test_valve () |
| | Test the valve by opening and closing it. More...
|
| |
| float32 | read_Valve_POS () |
| | Read the current position of the valve. More...
|
| |
| uint8 | zip_valve (char *labels[], float readings[], uint8 *array_ix, int *valve_trigger, uint8 max_size) |
| | Moves first valve and inserts current value of valve_trigger into labels and readings arrays. More...
|
| |
| uint8 | zip_valve_2 (char *labels[], float readings[], uint8 *array_ix, int *valve_2_trigger, uint8 max_size) |
| | Moves second valve and inserts current value of valve_2_trigger into labels and readings arrays. More...
|
| |
Declares functions for operating valve.
- Author
- Brandon Wong
- Version
- TODO
- Date
- 2017-06-19
| int move_valve |
( |
int |
valve | ) |
|
Move valve to the position indicated by valve.
- Parameters
-
| Position | to move the valve:
- 0: Completely open
- 100: Completely closed
- 1-99: Partially open
|
- Returns
- Number of iterations needed to close valve. TODO: Unclear.
| float32 read_Valve_POS |
( |
| ) |
|
Read the current position of the valve.
- Returns
- Position of the valve as a percent, with 0 meaning completely open and 100 meaning completely closed.
Test the valve by opening and closing it.
- Returns
- 1
| uint8 zip_valve |
( |
char * |
labels[], |
|
|
float |
readings[], |
|
|
uint8 * |
array_ix, |
|
|
int * |
valve_trigger, |
|
|
uint8 |
max_size |
|
) |
| |
Moves first valve and inserts current value of valve_trigger into labels and readings arrays.
- Parameters
-
| labels | Array to store labels corresponding to each trigger result |
| readings | Array to store trigger results as floating point values |
| array_ix | Array index to label and readings |
| max_size | Maximum size of label and reading arrays (number of entries) |
- Returns
- (*array_ix) + number of entries filled
| uint8 zip_valve_2 |
( |
char * |
labels[], |
|
|
float |
readings[], |
|
|
uint8 * |
array_ix, |
|
|
int * |
valve_2_trigger, |
|
|
uint8 |
max_size |
|
) |
| |
Moves second valve and inserts current value of valve_2_trigger into labels and readings arrays.
- Parameters
-
| labels | Array to store labels corresponding to each trigger result |
| readings | Array to store trigger results as floating point values |
| array_ix | Array index to label and readings |
| max_size | Maximum size of label and reading arrays (number of entries) |
- Returns
- (*array_ix) + number of entries filled