School project.
Dependencies: Timezone NTPClient BSP_DISCO_F746NG Grove_temperature
button_functions.h@20:9d4450357ce7, 2021-01-21 (annotated)
- Committer:
- tuxx0046
- Date:
- Thu Jan 21 12:43:03 2021 +0000
- Revision:
- 20:9d4450357ce7
- Parent:
- 15:638e65c37d58
Updated libraries used section in comments in main.cpp
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tuxx0046 | 13:41debc0b9063 | 1 | /** |
tuxx0046 | 14:3ac7c08dbc52 | 2 | @file button_functions.h |
tuxx0046 | 13:41debc0b9063 | 3 | @author Tu Tri Huynh |
tuxx0046 | 13:41debc0b9063 | 4 | @date January 18, 2021 |
tuxx0046 | 13:41debc0b9063 | 5 | @brief Functions related to Grove Button. |
tuxx0046 | 13:41debc0b9063 | 6 | */ |
tuxx0046 | 13:41debc0b9063 | 7 | |
tuxx0046 | 13:41debc0b9063 | 8 | /** |
tuxx0046 | 13:41debc0b9063 | 9 | This function reverses the bool value inputted if button press is registered. |
tuxx0046 | 13:41debc0b9063 | 10 | @is_fahrenheit Bool value to reverse. |
tuxx0046 | 13:41debc0b9063 | 11 | 1/18/2021 |
tuxx0046 | 13:41debc0b9063 | 12 | */ |
tuxx0046 | 15:638e65c37d58 | 13 | bool button_switch_temp_unit(DigitalIn& button, bool& is_fahrenheit) |
tuxx0046 | 13:41debc0b9063 | 14 | { |
tuxx0046 | 13:41debc0b9063 | 15 | if (button.read() == 1 ) |
tuxx0046 | 13:41debc0b9063 | 16 | { |
tuxx0046 | 13:41debc0b9063 | 17 | is_fahrenheit = helper_reverse_bool(is_fahrenheit); |
tuxx0046 | 15:638e65c37d58 | 18 | return true; |
tuxx0046 | 13:41debc0b9063 | 19 | } |
tuxx0046 | 15:638e65c37d58 | 20 | return false; |
tuxx0046 | 13:41debc0b9063 | 21 | } |