School project.
Dependencies: Timezone NTPClient BSP_DISCO_F746NG Grove_temperature
Diff: main.cpp
- Revision:
- 2:90d31841523a
- Parent:
- 1:1ee11539cc43
- Child:
- 3:02e7aac23ff9
--- a/main.cpp Wed Jan 13 10:36:30 2021 +0000 +++ b/main.cpp Wed Jan 13 11:50:32 2021 +0000 @@ -8,80 +8,33 @@ */ #include "mbed.h" - - +/// These are global variables and declared before most other things char building[31]; char room[31]; -//bool is_set = false; -/** -Declaration of the function (prototype) -@date 1/13/2021 -*/ -void setup_set_room_and_building(); - -/** -Confirm if happy with inputted information -@date 1/13/2021 -*/ -void setup_confirm() -{ - char answer; - printf("Type y for Yes, n for no: "); - scanf("%1s",&answer); - if (answer == 'y' || answer == 'Y') - { - //is_set = true; - printf("Setup successfully completed.\n"); - } - else - { - setup_set_room_and_building(); - } - printf("setup_confirm function end\n"); -} +/// Used to test the controller and make sure that it functions +DigitalOut myled(LED1); -/** -Show inputted information, and call setup_confirm to ask for confirmation. -@date 1/13/2021 -*/ -void setup_show_settings() -{ - printf("Is this correct?\n"); - printf("Building: %s\n", building); - printf("Room: %s\n", room); - setup_confirm(); -} +#include "setup_unit.h" -/** -Function to set building and room. Will call setup_show_settings to show what has been inputted. -@date 1/13/2021 -*/ -void setup_set_room_and_building() -{ - printf("Please set the building (maximum 30 characters): "); - scanf("%30s", building); - printf("Please set the room (maximum 30 characters): "); - scanf("%30s", room); - setup_show_settings(); -} + -/** -Function to run the initial setup process. -@date 1/13/2021 -*/ -void setup_run_setup() -{ - printf("Welcome to the Light Control System initial setup process\n"); - printf("Please set the units' location...\n\n"); - setup_set_room_and_building(); -} int main(){ /* printf("Mbed OS version: %d,%d,%d\n\n",MBED_MAJOR_VERSION, MBED_MINOR_VERSION, MBED_PATCH_VERSION); */ - setup_run_setup(); - printf("Setup done."); + setup_run_setup(); + while(1) + { + /** 01/13/2021 Used to test the controller and make sure that it functions.*/ + /** + printf("This is a test.\n"); + myled = 1; + wait_us(1000000); + myled = 0; + wait_us(1000000); + */ + } } \ No newline at end of file