New version of quadcopter software written to OO principles

Dependencies:   mbed MODSERIAL filter mbed-rtos ConfigFile PID PPM FreeIMU_external_magnetometer TinyGPS

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers LidarLitePwm.h Source File

LidarLitePwm.h

00001 #include "mbed.h"
00002 #include "filter.h"
00003 
00004 #ifndef LidarLitePwm_H
00005 #define LidarLitePwm_H
00006  
00007 class LidarLitePwm
00008 {
00009   public:
00010     LidarLitePwm(PinName input);
00011     ~LidarLitePwm();
00012     
00013     /// Returns range in cm as int
00014     int read();
00015     
00016     
00017     /// Returns the range in CM as an int
00018     operator int();
00019     
00020   private:
00021 
00022     /// Inturrupt at start of pulse
00023     void pulseStart();
00024     /// Interrupt at end of pulse
00025     void pulseStop();
00026     
00027     /// Interrupt driver for the input pin
00028     InterruptIn _interrupt;
00029     /// Timer
00030     Timer _timer;
00031     /// Time of the start of the current pulse
00032     int _pulseStartTime;
00033     /// The most recent sample
00034     int _range;
00035     
00036     filter* _lidarFilter;
00037 };
00038  
00039 #endif