![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Teacher version
Dependencies: mbed lib_workshop_2019
src/test_us/ft_print_value_us.cpp@5:d99659a45cab, 2019-10-24 (annotated)
- Committer:
- gvaquette
- Date:
- Thu Oct 24 03:54:20 2019 +0000
- Revision:
- 5:d99659a45cab
- Parent:
- 1:7a8764e627b5
Before first student version
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gvaquette | 1:7a8764e627b5 | 1 | #include "mbed.h" |
gvaquette | 1:7a8764e627b5 | 2 | #include "VMA306.h" |
gvaquette | 1:7a8764e627b5 | 3 | |
gvaquette | 1:7a8764e627b5 | 4 | #include "test_us.h" |
gvaquette | 1:7a8764e627b5 | 5 | |
gvaquette | 1:7a8764e627b5 | 6 | |
gvaquette | 1:7a8764e627b5 | 7 | void ft_print_value_US_front_to_pc(VMA306& ultra_sonic, Serial &pc) |
gvaquette | 1:7a8764e627b5 | 8 | { |
gvaquette | 1:7a8764e627b5 | 9 | if (ultra_sonic.isUSBReady()) pc.printf ("\r us_front = %5.2lf -", ultra_sonic.readUSB()); |
gvaquette | 1:7a8764e627b5 | 10 | } |
gvaquette | 1:7a8764e627b5 | 11 | |
gvaquette | 1:7a8764e627b5 | 12 | void ft_print_value_US_left_to_pc(VMA306& ultra_sonic, Serial &pc) |
gvaquette | 1:7a8764e627b5 | 13 | { |
gvaquette | 1:7a8764e627b5 | 14 | if (ultra_sonic.isUSGReady()) pc.printf (" us_left = %5.2lf -", ultra_sonic.readUSG()); |
gvaquette | 1:7a8764e627b5 | 15 | } |
gvaquette | 1:7a8764e627b5 | 16 | |
gvaquette | 1:7a8764e627b5 | 17 | void ft_print_value_US_right_to_pc(VMA306& ultra_sonic, Serial &pc) |
gvaquette | 1:7a8764e627b5 | 18 | { |
gvaquette | 1:7a8764e627b5 | 19 | if (ultra_sonic.isUSDReady()) pc.printf (" us_right = %5.2lf -", ultra_sonic.readUSD()); |
gvaquette | 1:7a8764e627b5 | 20 | } |
gvaquette | 1:7a8764e627b5 | 21 | |
gvaquette | 1:7a8764e627b5 | 22 | void ft_print_all_values_US(VMA306 &ultra_sonic, Serial &pc) |
gvaquette | 1:7a8764e627b5 | 23 | { |
gvaquette | 1:7a8764e627b5 | 24 | ft_print_value_US_left_to_pc(ultra_sonic, pc); |
gvaquette | 1:7a8764e627b5 | 25 | ft_print_value_US_front_to_pc(ultra_sonic, pc); |
gvaquette | 1:7a8764e627b5 | 26 | ft_print_value_US_right_to_pc(ultra_sonic, pc); |
gvaquette | 1:7a8764e627b5 | 27 | } |