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
Diff: PwmReader.cpp
- Revision:
- 7:e005cfaff8d1
- Parent:
- 6:a4d6f3e4bf28
diff -r a4d6f3e4bf28 -r e005cfaff8d1 PwmReader.cpp --- a/PwmReader.cpp Wed Jan 29 05:04:50 2014 +0000 +++ b/PwmReader.cpp Thu Jan 30 02:04:23 2014 +0000 @@ -14,13 +14,17 @@ lastRise = 0; period = 0; duty = 0.0; + di->mode(PullDown); di->rise(this,&PwmReader::pwmRise); // attach the address of the flip function to the rising edge di->fall(this,&PwmReader::pwmFall); + + t.start(); } PwmReader::~PwmReader() { delete di; + t.stop(); } // public methods