School project.
Dependencies: Timezone NTPClient BSP_DISCO_F746NG Grove_temperature
helper_functions.h@8:1a1e7cf7dcb6, 2021-01-14 (annotated)
- Committer:
- tuxx0046
- Date:
- Thu Jan 14 12:41:37 2021 +0000
- Revision:
- 8:1a1e7cf7dcb6
- Child:
- 10:137cf2c92871
Refactored and renamed functions and file to better suit future needs.; light_sensor_functions -> helper_functions
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tuxx0046 | 8:1a1e7cf7dcb6 | 1 | /** |
tuxx0046 | 8:1a1e7cf7dcb6 | 2 | @file helper_functions.h |
tuxx0046 | 8:1a1e7cf7dcb6 | 3 | @brief Contains functions to help with general tasks |
tuxx0046 | 8:1a1e7cf7dcb6 | 4 | @author Tu Tri Huynh |
tuxx0046 | 8:1a1e7cf7dcb6 | 5 | @date 1/14/2021 |
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 | 8:1a1e7cf7dcb6 | 10 | 1/14/2021 |
tuxx0046 | 8:1a1e7cf7dcb6 | 11 | */ |
tuxx0046 | 8:1a1e7cf7dcb6 | 12 | int helper_get_sensor_read_in_percent(float read_value) |
tuxx0046 | 8:1a1e7cf7dcb6 | 13 | { |
tuxx0046 | 8:1a1e7cf7dcb6 | 14 | return (int)(read_value*100); |
tuxx0046 | 8:1a1e7cf7dcb6 | 15 | } |