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.
Fork of CPBR_KL46Z_EX4 by
Revision 1:0717f1ea2352, committed 2017-05-19
- Comitter:
- FBSEletronica
- Date:
- Fri May 19 21:07:36 2017 +0000
- Parent:
- 0:cc1610c8817f
- Commit message:
- Example 4 Hands on KL46
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Jan 31 19:13:04 2017 +0000
+++ b/main.cpp Fri May 19 21:07:36 2017 +0000
@@ -7,16 +7,15 @@
int main()
{
- int value = 0;
-
-
- slcd.clear();
+ int value = 0;
+
+ slcd.clear(); //clear LCD
while (true) {
led = !led; // toggle led
- slcd.printf("%04d", value); // print the heading (NED compass) to the LCD
- value++;
- if(value>1000) value = 0;
- wait(0.2f);
+ slcd.printf("%04d", value); // print value on LCD
+ value++; //Value = Value+1
+ if(value>100) value = 0; //if value passed 1K -> reset counter
+ wait(0.2); //wait 200 ms
}
}
\ No newline at end of file
