![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Tuk tutoriail
Dependencies: mbed lib_workshop_2019
src/test_cny/ft_print_value_cny.cpp@10:2c17068cb551, 2019-10-28 (annotated)
- Committer:
- dgwambaa
- Date:
- Mon Oct 28 09:19:57 2019 +0000
- Revision:
- 10:2c17068cb551
- Parent:
- 7:c7ff04228b11
save test
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gvaquette | 2:8153195b1672 | 1 | /** |
gvaquette | 2:8153195b1672 | 2 | * @author geoffrey Vaquette |
gvaquette | 2:8153195b1672 | 3 | * |
gvaquette | 2:8153195b1672 | 4 | * @section DESCRIPTION |
gvaquette | 2:8153195b1672 | 5 | * |
gvaquette | 2:8153195b1672 | 6 | * Testing value from ultrasonic sensors on robot |
gvaquette | 2:8153195b1672 | 7 | * |
gvaquette | 2:8153195b1672 | 8 | */ |
gvaquette | 2:8153195b1672 | 9 | |
gvaquette | 2:8153195b1672 | 10 | #include "mbed.h" |
gvaquette | 2:8153195b1672 | 11 | #include "CNY70.h" |
gvaquette | 2:8153195b1672 | 12 | |
gvaquette | 2:8153195b1672 | 13 | |
gvaquette | 2:8153195b1672 | 14 | void ft_print_cny_analog_voltage(AnalogIn &analog_input, Serial &pc) |
gvaquette | 2:8153195b1672 | 15 | { |
gvaquette | 7:c7ff04228b11 | 16 | const double max_voltage = 3.3; |
gvaquette | 2:8153195b1672 | 17 | /* TO BE IMPLEMENTED */ |
dgwambaa | 10:2c17068cb551 | 18 | double value; |
dgwambaa | 10:2c17068cb551 | 19 | double voltage; |
dgwambaa | 10:2c17068cb551 | 20 | value=analog_input.read(); |
dgwambaa | 10:2c17068cb551 | 21 | voltage=value * max_voltage; |
dgwambaa | 10:2c17068cb551 | 22 | |
dgwambaa | 10:2c17068cb551 | 23 | pc.printf("Voltage value : %lf ", voltage); |
gvaquette | 2:8153195b1672 | 24 | return; |
gvaquette | 2:8153195b1672 | 25 | } |
gvaquette | 2:8153195b1672 | 26 | |
gvaquette | 2:8153195b1672 | 27 | |
gvaquette | 2:8153195b1672 | 28 | void ft_print_cny_library_voltage(CNY70 &cny_sensor, Serial &pc) |
gvaquette | 2:8153195b1672 | 29 | { |
gvaquette | 2:8153195b1672 | 30 | return; |
gvaquette | 2:8153195b1672 | 31 | } |