New version of quadcopter software written to OO principles
Dependencies: mbed MODSERIAL filter mbed-rtos ConfigFile PID PPM FreeIMU_external_magnetometer TinyGPS
Diff: Sensors/LidarLitePwm/LidarLitePwm.h
- Revision:
- 4:9ffbf9101992
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Sensors/LidarLitePwm/LidarLitePwm.h Fri May 08 09:07:38 2015 +0000
@@ -0,0 +1,39 @@
+#include "mbed.h"
+#include "filter.h"
+
+#ifndef LidarLitePwm_H
+#define LidarLitePwm_H
+
+class LidarLitePwm
+{
+ public:
+ LidarLitePwm(PinName input);
+ ~LidarLitePwm();
+
+ /// Returns range in cm as int
+ int read();
+
+
+ /// Returns the range in CM as an int
+ operator int();
+
+ private:
+
+ /// Inturrupt at start of pulse
+ void pulseStart();
+ /// Interrupt at end of pulse
+ void pulseStop();
+
+ /// Interrupt driver for the input pin
+ InterruptIn _interrupt;
+ /// Timer
+ Timer _timer;
+ /// Time of the start of the current pulse
+ int _pulseStartTime;
+ /// The most recent sample
+ int _range;
+
+ filter* _lidarFilter;
+};
+
+#endif
\ No newline at end of file
Joseph Roberts