the fish that looks like a jet

Dependencies:   ADXL345 ADXL345_I2C IMUfilter ITG3200 mbed Servo

PwmReader.h

Committer:
rkk
Date:
2014-02-17
Revision:
16:79cfe6201318
Parent:
8:0574a5db1fc4

File content as of revision 16:79cfe6201318:

#pragma once
#include "mbed.h"

class PwmReader
{
    public:
    PwmReader();
    PwmReader(PinName pwmInPort, float min = 0.0, float max = 1.0);
    ~PwmReader();
    
    float getDuty();         //0 to 1
    
    protected:
    void pwmRise();    
    void pwmFall();    
    void pwmRise2();    
    void pwmFall2(); 
    
    private:
    InterruptIn* di;
    int lastRise;
    int period;
    float duty;
    Timer t;
    float pwmMin;
    float pwmMax; 
    
};