My modifications/additions to the code

Dependencies:   ADXL345 ADXL345_I2C IMUfilter ITG3200 Servo fishgait mbed-rtos mbed pixy_cam

Fork of robotic_fish_ver_4_8 by jetfishteam

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers PwmReader.h Source File

PwmReader.h

00001 #pragma once
00002 #include "mbed.h"
00003 
00004 class PwmReader
00005 {
00006     public:
00007     PwmReader();
00008     PwmReader(PinName pwmInPort, float min = 0.0, float max = 1.0);
00009     ~PwmReader();
00010     
00011     float getDuty();         //0 to 1
00012     
00013     protected:
00014     void pwmRise();    
00015     void pwmFall();    
00016     void pwmRise2();    
00017     void pwmFall2(); 
00018     
00019     private:
00020     InterruptIn* di;
00021     int lastRise;
00022     int period;
00023     float duty;
00024     Timer t;
00025     float pwmMin;
00026     float pwmMax; 
00027     
00028 };