![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Smartage application
Dependencies: BufferedSerial SX1276GenericLib USBDeviceHT mbed Crypto X_NUCLEO_IKS01A2
Fork of STM32L0_LoRa by
hcsr04.h@29:04e1489f8fe2, 2018-09-17 (annotated)
- Committer:
- marcozecchini
- Date:
- Mon Sep 17 20:37:51 2018 +0000
- Revision:
- 29:04e1489f8fe2
Bug fixed
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
marcozecchini | 29:04e1489f8fe2 | 1 | #ifndef hcsr04_H |
marcozecchini | 29:04e1489f8fe2 | 2 | #define hcsr04_H |
marcozecchini | 29:04e1489f8fe2 | 3 | #include "mbed.h" |
marcozecchini | 29:04e1489f8fe2 | 4 | |
marcozecchini | 29:04e1489f8fe2 | 5 | |
marcozecchini | 29:04e1489f8fe2 | 6 | |
marcozecchini | 29:04e1489f8fe2 | 7 | class HCSR04 { |
marcozecchini | 29:04e1489f8fe2 | 8 | public: |
marcozecchini | 29:04e1489f8fe2 | 9 | HCSR04(PinName t, PinName e); |
marcozecchini | 29:04e1489f8fe2 | 10 | long echo_duration(); |
marcozecchini | 29:04e1489f8fe2 | 11 | long distance(); |
marcozecchini | 29:04e1489f8fe2 | 12 | |
marcozecchini | 29:04e1489f8fe2 | 13 | private: |
marcozecchini | 29:04e1489f8fe2 | 14 | DigitalOut trig; |
marcozecchini | 29:04e1489f8fe2 | 15 | DigitalIn echo; |
marcozecchini | 29:04e1489f8fe2 | 16 | Timer timer; |
marcozecchini | 29:04e1489f8fe2 | 17 | long duration,distance_cm; |
marcozecchini | 29:04e1489f8fe2 | 18 | }; |
marcozecchini | 29:04e1489f8fe2 | 19 | |
marcozecchini | 29:04e1489f8fe2 | 20 | #endif |