Kazu Zamasu
/
mbed_timer
timer reference. on 1114-mbed
main.cpp
- Committer:
- kazu_zamasu
- Date:
- 2015-01-28
- Revision:
- 1:57ee27a9df19
- Parent:
- 0:2a4387a90647
File content as of revision 1:57ee27a9df19:
#include "mbed.h" Timer TSGtimer; DigitalIn TSG(dp17,PullUp); DigitalOut DLEDG(dp14,0); Serial pc(USBTX, USBRX); int hoges,hogee; int main() { pc.baud(115200); while(1) { DLEDG = !TSG; if ( TSG == 1 && 0 != TSGtimer.read_ms()){ TSGtimer.stop(); TSGtimer.reset(); } else if ( TSG == 0){ TSGtimer.start(); hogee=TSGtimer.read_ms(); printf("\033[4;1H"); printf("\033[K"); printf("TSG-on times by msec %d\n", hogee); } } }