Creating a CoxBox with the mbed
Dependencies: mbed C12832 SMARTGPU2
Diff: TimerCB.cpp
- Revision:
- 12:b46ebe5d3cbe
- Parent:
- 9:f49dfeb4d3d5
- Child:
- 14:03ce6381dce6
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TimerCB.cpp Sun May 04 21:49:44 2014 +0000 @@ -0,0 +1,38 @@ +#include "mbed.h" +#include "C12832.h" +#include "TimerCB.h" + +TimerCB::TimerCB(){ + +} + +int TimerCB::getMinutes(){ + int secs = (int)timer.read(); + int min = secs/60; + return min; +} + +int TimerCB::getSeconds(){ + int secs = (int)timer.read(); + secs = secs%60; + return secs; +} + +int TimerCB::getMS(){ + int millis = timer.read_ms(); + millis = millis%1000; + return millis; +} + +void TimerCB::start(){ + timer.start(); +} + +void TimerCB::stop(){ + timer.stop(); +} + +void TimerCB::reset(){ + timer.reset(); + timer.stop(); +} \ No newline at end of file