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 1:acb591685a28, committed 2021-02-04
- Comitter:
- ajp109
- Date:
- Thu Feb 04 17:12:01 2021 +0000
- Parent:
- 0:77209603a6fe
- Child:
- 2:ebee08edbab9
- Commit message:
- Initial commit (lab7)
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Jan 11 11:28:11 2021 +0000
+++ b/main.cpp Thu Feb 04 17:12:01 2021 +0000
@@ -1,15 +1,14 @@
#include "mbed.h"
+DigitalOut green(D2);
+DigitalOut red(D3);
+
int main()
{
- int x = 4;
- x = 6;
- int y;
- y = 2*x;
- x = 7;
-
- printf("x:%d y:%d\n", x, y);
-
- // Do nothing, forever...
- while (true);
+ while (true) {
+ green = true;
+ thread_sleep_for(500);
+ green = false;
+ thread_sleep_for(2500);
+ }
}