1 sensor using RTOS Timer, another 2 over RTOS Semaphore
Dependents: Autonomous_quadcopter
Fork of HCSR04 by
Diff: hcsr04.h
- Revision:
- 8:0a10bacaf501
- Parent:
- 7:dcf0aa89bcd7
- Child:
- 11:49a0feca5d71
diff -r dcf0aa89bcd7 -r 0a10bacaf501 hcsr04.h --- a/hcsr04.h Sun Feb 25 18:31:44 2018 +0000 +++ b/hcsr04.h Sat Mar 03 15:37:39 2018 +0000 @@ -39,7 +39,7 @@ public: HCSR04(PinName t1, PinName e1, PinName t2, PinName e2); - uint16_t getDistan1(); + int getDistan1(); uint16_t getDistan2(); private: @@ -56,12 +56,13 @@ uint32_t limit; Timer timer1; + Timer timerLimit; Timer timer2; RtosTimer *threadUpdateTimer1; RtosTimer *threadUpdateTimer2; - uint32_t distan1; + int distan1; uint32_t distan2; };