School project.
Dependencies: Timezone NTPClient BSP_DISCO_F746NG Grove_temperature
helper_functions.h@10:137cf2c92871, 2021-01-15 (annotated)
- Committer:
- tuxx0046
- Date:
- Fri Jan 15 09:27:26 2021 +0000
- Revision:
- 10:137cf2c92871
- Parent:
- 8:1a1e7cf7dcb6
- Child:
- 13:41debc0b9063
Add serial communication service functions.; Major changes to comments.; Minor fixes to code to clear buffer in console when typing etc.;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tuxx0046 | 8:1a1e7cf7dcb6 | 1 | /** |
tuxx0046 | 10:137cf2c92871 | 2 | @file helper_functions.h |
tuxx0046 | 10:137cf2c92871 | 3 | @author Tu Tri Huynh |
tuxx0046 | 10:137cf2c92871 | 4 | @date January 14, 2021 |
tuxx0046 | 10:137cf2c92871 | 5 | @brief Functions to help with general tasks. |
tuxx0046 | 8:1a1e7cf7dcb6 | 6 | */ |
tuxx0046 | 8:1a1e7cf7dcb6 | 7 | |
tuxx0046 | 8:1a1e7cf7dcb6 | 8 | /** |
tuxx0046 | 8:1a1e7cf7dcb6 | 9 | This function returns the percentage of AnalogIn sensor read values that by default are floating point numbers between 0.00 to 1.00. |
tuxx0046 | 10:137cf2c92871 | 10 | @read_value Float value from the read() function in analog units. |
tuxx0046 | 8:1a1e7cf7dcb6 | 11 | 1/14/2021 |
tuxx0046 | 8:1a1e7cf7dcb6 | 12 | */ |
tuxx0046 | 8:1a1e7cf7dcb6 | 13 | int helper_get_sensor_read_in_percent(float read_value) |
tuxx0046 | 8:1a1e7cf7dcb6 | 14 | { |
tuxx0046 | 8:1a1e7cf7dcb6 | 15 | return (int)(read_value*100); |
tuxx0046 | 8:1a1e7cf7dcb6 | 16 | } |