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 5:b760013d9d08, committed 2016-10-06
- Comitter:
- screamer
- Date:
- Thu Oct 06 19:23:24 2016 +0100
- Parent:
- 4:067032ed9bd3
- Commit message:
- Improved test LED patterns
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Feb 13 09:45:19 2015 +0000
+++ b/main.cpp Thu Oct 06 19:23:24 2016 +0100
@@ -20,13 +20,38 @@
BusOut bus1(D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, D13, D14, D15);
BusOut bus2(A5, A4, A3, A2, A1, A0);
-int i;
+int i, j, l = 15, c = 3, r = 6;
+float s = 0.1;
int main()
{
- for (i=0; i<=65535; i++) {
- bus1 = i;
- bus2 = i;
- wait(0.001);
+ bus1 = bus2 = 0;
+ for (i=0; i<=l; i++) {
+ bus1 = bus1 + (1 << i | 1 << i+1 | 1 << i+2);
+ bus2 = bus2 + (1 << i | 1 << i+1 | 1 << i+2);
+ wait(s);
+ i=i+2;
+ }
+
+ bus1 = bus2 = 0;
+ for (j=0; j<c; j++) {
+ for (i=0; i<=l; i++) {
+ bus1 = bus1 + (1 << i+j);
+ bus2 = bus2 + (1 << i+j);
+ wait(s);
+ i=i+2;
+ }
+ }
+
+ bus1 = bus2 = 0;
+ for (i=0; i<=l; i++) {
+ bus1 = bus1 + (1 << i);
+ bus2 = bus2 + (1 << i);
+ wait(s);
+ }
+ for (i=0; i<=l; i++) {
+ bus1 = bus1 - (1 << i);
+ bus2 = bus2 - (1 << i);
+ wait(s);
}
}
\ No newline at end of file