![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Tutorial for first mbed project
Dependencies: mbed lib_workshop_2019
src/test_cny/ft_print_value_cny.cpp@2:8153195b1672, 2019-10-23 (annotated)
- Committer:
- gvaquette
- Date:
- Wed Oct 23 13:56:30 2019 +0000
- Revision:
- 2:8153195b1672
- Child:
- 7:c7ff04228b11
cny testing analog input
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 | 2:8153195b1672 | 16 | /* TO BE IMPLEMENTED */ |
gvaquette | 2:8153195b1672 | 17 | const double max_voltage = 3.3; |
gvaquette | 2:8153195b1672 | 18 | double value = analog_input.read(); |
gvaquette | 2:8153195b1672 | 19 | double voltage = value * max_voltage; |
gvaquette | 2:8153195b1672 | 20 | pc.printf("voltage value : %lf V ", voltage); |
gvaquette | 2:8153195b1672 | 21 | return; |
gvaquette | 2:8153195b1672 | 22 | } |
gvaquette | 2:8153195b1672 | 23 | |
gvaquette | 2:8153195b1672 | 24 | |
gvaquette | 2:8153195b1672 | 25 | void ft_print_cny_library_voltage(CNY70 &cny_sensor, Serial &pc) |
gvaquette | 2:8153195b1672 | 26 | { |
gvaquette | 2:8153195b1672 | 27 | /* TO BE COMPUTED */ |
gvaquette | 2:8153195b1672 | 28 | return; |
gvaquette | 2:8153195b1672 | 29 | } |