the fish that looks like a jet
Dependencies: ADXL345 ADXL345_I2C IMUfilter ITG3200 mbed Servo
PwmReader.h@7:e005cfaff8d1, 2014-01-30 (annotated)
- Committer:
- sandwich
- Date:
- Thu Jan 30 02:04:23 2014 +0000
- Revision:
- 7:e005cfaff8d1
- Parent:
- 6:a4d6f3e4bf28
- Child:
- 8:0574a5db1fc4
removed rtos and added interrupt reading
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sandwich | 5:090ef6275773 | 1 | #pragma once |
sandwich | 5:090ef6275773 | 2 | #include "mbed.h" |
sandwich | 5:090ef6275773 | 3 | |
sandwich | 5:090ef6275773 | 4 | class PwmReader |
sandwich | 5:090ef6275773 | 5 | { |
sandwich | 5:090ef6275773 | 6 | public: |
sandwich | 5:090ef6275773 | 7 | PwmReader(); |
rkk | 6:a4d6f3e4bf28 | 8 | PwmReader(PinName pwmInPort, float min = 0.0, float max = 1.0); |
sandwich | 5:090ef6275773 | 9 | ~PwmReader(); |
sandwich | 5:090ef6275773 | 10 | |
sandwich | 5:090ef6275773 | 11 | float getDuty(); //0 to 1 |
sandwich | 5:090ef6275773 | 12 | |
sandwich | 5:090ef6275773 | 13 | protected: |
sandwich | 7:e005cfaff8d1 | 14 | void pwmRise(); |
sandwich | 7:e005cfaff8d1 | 15 | void pwmFall(); |
sandwich | 5:090ef6275773 | 16 | |
rkk | 6:a4d6f3e4bf28 | 17 | private: |
sandwich | 5:090ef6275773 | 18 | InterruptIn* di; |
sandwich | 5:090ef6275773 | 19 | int lastRise; |
sandwich | 5:090ef6275773 | 20 | int period; |
sandwich | 5:090ef6275773 | 21 | float duty; |
rkk | 6:a4d6f3e4bf28 | 22 | Timer t; |
rkk | 6:a4d6f3e4bf28 | 23 | float pwmMin; |
rkk | 6:a4d6f3e4bf28 | 24 | float pwmMax; |
sandwich | 5:090ef6275773 | 25 | |
sandwich | 5:090ef6275773 | 26 | }; |