... | ... | @@ -97,7 +97,7 @@ This function may only be called once. |
|
|
sends a string with a maximum length of 40 chars over bluetooth uart.
|
|
|
|
|
|
#### void HDU_BLUETOOTH_sendDebugMesssage(char *message, float value, char *unit)
|
|
|
can be used to debug a variable in the format "message: value unit\n".
|
|
|
can be used to debug a variable in the format <code>"message: value unit\n"</code>.
|
|
|
|
|
|
### Example
|
|
|
Debug a variable:
|
... | ... | @@ -107,6 +107,39 @@ float vbat = 7,9; |
|
|
HDU_BLUETOOTH_sendDebugMessage("VBAT", vbat, "V");
|
|
|
</code>
|
|
|
## HMI interaction (HDU_HMI.h)
|
|
|
With this Module You can acces the HMI of the HighDriveUnit including, 2 potentiometers, 8 dipswitches, 2 puschbuttons and 4 LEDs.
|
|
|
|
|
|
### Module documentation
|
|
|
|
|
|
#### typedef struct HDU_HMI_UserInput
|
|
|
This struct stores all hmi data (poti values, dipswitch values and button states).
|
|
|
There is one instance to be used called HDU_HMI_userInput.
|
|
|
|
|
|
#### void HDU_HMI_init()
|
|
|
This funciton initializes the HMI Module and may only be called once.
|
|
|
|
|
|
#### void HDU_HMI_readUserInput()
|
|
|
reads all data to the user input struct.
|
|
|
|
|
|
#### uint8_t HDU_HMI_readDipswitches()
|
|
|
reads the 8-bit value of all dipswitches using multiplexing. This function can also be used if switchbank 1 is enabled continously.
|
|
|
|
|
|
#### bool HDU_HMI_readBtnX
|
|
|
returns the state of button A or B. True is pushed.
|
|
|
|
|
|
#### uint16_t HDU_HMI_readPotX()
|
|
|
returns the value of potentiometer A or B from 0 to fff.
|
|
|
|
|
|
#### void HDU_HMI_setLEDs(uint8_t value)
|
|
|
shows a 4-bit value on the LEDs.
|
|
|
|
|
|
### Software Example
|
|
|
Get dipswitches value from the user input struct and decode it to the LEDs:
|
|
|
<code>
|
|
|
HDU_HMI_init();
|
|
|
HDU_HMI_readUserInput();
|
|
|
setLEDs(HDU_HMI_userInput.dipswitches);
|
|
|
</code>
|
|
|
|
|
|
## Camera reading (HDU_LINESCAN.h)
|
|
|
|
... | ... | |