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 1:0cbc07037f22, committed 2021-05-31
- Comitter:
- momidi
- Date:
- Mon May 31 06:27:41 2021 +0000
- Parent:
- 0:6ab419decf1c
- Commit message:
- test
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sun May 30 03:43:15 2021 +0000
+++ b/main.cpp Mon May 31 06:27:41 2021 +0000
@@ -1,17 +1,16 @@
#include "mbed.h"
-
-DigitalOut led[]= {LED1,LED2,LED3};
+DigitalOut led(LED3);
Serial pc(USBTX, USBRX);
-
int main()
{
while(1) {
- for(int i=0; i<3; i++) {
- led[i]=1;
- pc.printf("LED%d is ON\r\n",i+1);
- wait(1);
- led[i]=0;
- wait(1);
+ for(int i=1; i<4; i++) {
+ led=1;
+ pc.printf("LED%d is ON\r\n",3);
+ wait(i);
+ led=0;
+ pc.printf("LED%d is OFF\r\n",3);
+ wait(i);
}
}
}
\ No newline at end of file