Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Revision 0:c7377fa95fab, committed 2015-10-15
- Comitter:
- madmonkeyman82
- Date:
- Thu Oct 15 15:54:42 2015 +0000
- Commit message:
- first
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r c7377fa95fab main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Oct 15 15:54:42 2015 +0000 @@ -0,0 +1,44 @@ +#include "mbed.h" + +InterruptIn SW7(PB_3); +InterruptIn SW6(PA_10); + +Timer timer; + +void startKlokke(); +void stoppKlokke(); +void print(); + +int main() +{ + + printf("Velkommen\n"); + + SW7.fall(&startKlokke); + SW6.fall(&stoppKlokke); + + while(1) + { + + } + +} +void startKlokke() +{ + timer.reset(); + timer.start(); +} + +void stoppKlokke() +{ + timer.stop(); + print(); +} + +void print() +{ + float tidSek=timer.read(); + float hastighet = (5/tidSek)*3.6; + + printf("Hastighet %.2f Km\\t\r\n", hastighet); +} \ No newline at end of file
diff -r 000000000000 -r c7377fa95fab mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Oct 15 15:54:42 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/ba1f97679dad \ No newline at end of file