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.
Revision 0:65dee900759a, committed 2018-11-15
- Comitter:
- Wizo
- Date:
- Thu Nov 15 18:05:27 2018 +0000
- Commit message:
- Timer
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 65dee900759a main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Thu Nov 15 18:05:27 2018 +0000
@@ -0,0 +1,19 @@
+#include "mbed.h"
+Timer timer1; // define timer object
+DigitalOut output1(p5); // digital output
+void task1(void); // task function prototype
+//*** main code
+int main()
+{
+ timer1.start(); // start timer counting
+ while(1) {
+ if (timer1.read_ms()>=200) { // read time in ms
+ task1(); // call task function
+ timer1.reset(); // reset timer
+ }
+ }
+}
+void task1(void) // task function
+{
+ output1=!output1; // toggle output
+}
\ No newline at end of file
diff -r 000000000000 -r 65dee900759a mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Nov 15 18:05:27 2018 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/5aab5a7997ee \ No newline at end of file