![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
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
PwmReader.h
- Committer:
- rkk
- Date:
- 2014-01-29
- Revision:
- 6:a4d6f3e4bf28
- Parent:
- 5:090ef6275773
- Child:
- 7:e005cfaff8d1
File content as of revision 6:a4d6f3e4bf28:
#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(); //0 to 1 void pwmFall(); //-1 to 1 private: InterruptIn* di; int lastRise; int period; float duty; Timer t; float pwmMin; float pwmMax; };