Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of MaxbotixDriver by
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
Generated on Thu Jul 14 2022 12:04:14 by
1.7.2
