![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Tutorial for first mbed project
Dependencies: mbed lib_workshop_2019
Diff: main.cpp
- Revision:
- 1:7a8764e627b5
- Parent:
- 0:0a75a79d6b77
- Child:
- 2:8153195b1672
diff -r 0a75a79d6b77 -r 7a8764e627b5 main.cpp --- a/main.cpp Wed Oct 23 12:16:18 2019 +0000 +++ b/main.cpp Wed Oct 23 13:01:35 2019 +0000 @@ -1,8 +1,46 @@ #include "mbed.h" + #include "console_output.h" +#include "test_us.h" +#include "test_compass.h" + +#include "pin_connexions.h" + + Serial pc (PA_2, PA_3, 115200); int main() { + e_test user_choice ; ft_print_test_menu(pc); + user_choice = ft_get_user_choice(pc); + + while(1) + { + switch (user_choice) + { + case ULTRASONIC : + do + { + ft_print_all_values_US(ultra_sonic, pc); + } while (!pc.readable()); + user_choice = ft_get_user_choice(pc); + pc.printf("\n"); + break; + + case COMPASS : + do + { + ft_print_compass_values(compass, pc); + } while (!pc.readable()); + pc.printf("\n"); + user_choice = ft_get_user_choice(pc); + break; + default : + ft_print_test_menu(pc); + user_choice = ft_get_user_choice(pc); + break; + } + } + } \ No newline at end of file