the fish that looks like a jet
Dependencies: ADXL345 ADXL345_I2C IMUfilter ITG3200 mbed Servo
PwmReader.h@6:a4d6f3e4bf28, 2014-01-29 (annotated)
- Committer:
- rkk
- Date:
- Wed Jan 29 05:04:50 2014 +0000
- Revision:
- 6:a4d6f3e4bf28
- Parent:
- 5:090ef6275773
- Child:
- 7:e005cfaff8d1
added pam ira
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 | 5:090ef6275773 | 14 | void pwmRise(); //0 to 1 |
sandwich | 5:090ef6275773 | 15 | void pwmFall(); //-1 to 1 |
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 | }; |