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:cbdba17a7bd5, committed 2017-03-06
- Comitter:
- rtandil
- Date:
- Mon Mar 06 10:41:39 2017 +0000
- Parent:
- 0:99aabdc13d25
- Commit message:
- First commit
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 99aabdc13d25 -r cbdba17a7bd5 main.cpp
--- a/main.cpp Thu Mar 02 02:53:49 2017 +0000
+++ b/main.cpp Mon Mar 06 10:41:39 2017 +0000
@@ -1,8 +1,7 @@
#include "mbed.h"
-DigitalIn count(D2);
-
-int i = 0;
+DigitalIn count(USER_BUTTON);
+DigitalOut myled(LED1);
int main()
{
while(1)
@@ -10,12 +9,15 @@
if (count == 1)
{
+ wait_ms(100);
if (count == 0)
{
- i++;
- printf("barang = %d\n",i);
- }
+ myled = 1;
+ }
+ else
+ {
+ myled = 0;
+ }
}
-
}
}
