Programmi Esempio
/
1_Sensore_Ultrasuoni
Sensore Ultrasuoni
Revision 0:70789ba39324, committed 2018-12-18
- Comitter:
- DonatoSt
- Date:
- Tue Dec 18 22:27:19 2018 +0000
- Commit message:
- sensore ultrasuoni
Changed in this revision
diff -r 000000000000 -r 70789ba39324 HCSR04.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/HCSR04.lib Tue Dec 18 22:27:19 2018 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/prabhuvd/code/HCSR04/#71da0dbf4400
diff -r 000000000000 -r 70789ba39324 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Dec 18 22:27:19 2018 +0000 @@ -0,0 +1,15 @@ +#include "mbed.h" +#include "hcsr04.h" + + HCSR04 sensor (D15, D14); + Serial pc(USBTX, USBRX); + int main (){ + pc.baud(9600); + while(1) { + sensor.start(); + wait_ms(100); + pc.printf("%dcm\t", sensor.get_dist_cm()); + } + +} +
diff -r 000000000000 -r 70789ba39324 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Dec 18 22:27:19 2018 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/0ab6a29f35bf \ No newline at end of file