11 years, 5 months ago.

make a stop clock

Have some one a code witch can stop the time? (For example the time betwen start and finish) Is it possible to show a interim?

Thanks for help

2 Answers

11 years, 5 months ago.

Timer? http://mbed.org/handbook/Timer

Accepted Answer

Thanks but is it possible only to show 2 sign after comma?

posted by Daniel Moser 15 Dec 2012

The timer gives the 'exact' result back, how much you show depends on your print function, have a look at: http://www.cplusplus.com/reference/cstdio/printf/. Should be %.2f instead of %f.

posted by Erik - 15 Dec 2012
11 years, 5 months ago.

Thanks and how can i make alarm clock? That at 6:00PM for example a led set to 1 if this is impossible is it possible to count down with a timer?

The timer is mainly intended for relative short periods. For this, you are better off using the RTC: http://mbed.org/projects/libraries/api/mbed/trunk/rtc_time. And I just happen to have a library published which adds some interrupts to RTC, for for example alarms: http://mbed.org/users/Sissors/code/RTC/

posted by Erik - 13 Dec 2012