This library is derived library of DigitalOut. Cumulative counter that detected the Hi edge and I have the operation cumulative time function .
Diff: LogDigitalOut.cpp
- Revision:
- 0:b63c87da380a
- Child:
- 1:23b306c0a0b2
diff -r 000000000000 -r b63c87da380a LogDigitalOut.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LogDigitalOut.cpp Thu Jan 29 06:28:17 2015 +0000 @@ -0,0 +1,31 @@ +#include "LogDigitalOut.h" +#include "mbed.h" + +LogDigitalOut::LogDigitalOut(PinName pin) : _pin(pin) { + _pin = 0; +} +void LogDigitalOut::CountUp() { + if (buffer==0) { + if (_pin) { + count ++; + } + } + buffer = _pin; +} +void LogDigitalOut::RatiosUp() { + if (_pin) { + ratios ++; + } +} +int LogDigitalOut::GetCount() { + return count; +} +int LogDigitalOut::GetRatios() { + return ratios; +} +int LogDigitalOut::Read() { + return _pin; +} +void LogDigitalOut::Write(int volume) { + _pin = volume; +} \ No newline at end of file