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.
Diff: main.cpp
- Revision:
- 0:82137a569230
diff -r 000000000000 -r 82137a569230 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Thu Nov 29 06:27:33 2018 +0000
@@ -0,0 +1,76 @@
+#include "mbed.h"
+
+BusOut Led(D7,D8,D9,D10);
+DigitalIn asc(D6);
+int n = 0;
+
+
+int main() {
+ while(1) {
+ wait(0.15);
+ if(asc == 1) {
+ n = n+1;
+ if(n == 16) {
+ n = 0;
+ }
+ }
+ if (n == 0) {
+ Led= 0x00; // 0
+ }
+
+ if (n == 1) {
+ Led= 0x01; // 1
+ }
+
+ if (n == 2) {
+ Led= 0x02; // 2
+ }
+
+ if (n == 3) {
+ Led= 0x03; // 3
+ }
+
+ if (n == 4) {
+ Led= 0x04; // 4
+ }
+
+ if (n == 5) {
+ Led= 0x05; // 5
+ }
+
+ if (n == 6) {
+ Led= 0x06; // 6
+ }
+
+ if (n == 7) {
+ Led= 0x07; // 7
+ }
+
+ if (n == 8) {
+ Led= 0x08; // 8
+ }
+
+ if (n == 9) {
+ Led= 0x09; // 9
+ }
+
+ if (n == 10) {
+ Led= 0x0A; // 10
+ }
+ if (n == 11) {
+ Led= 0x0B; // 11
+ }
+ if (n == 12) {
+ Led= 0x0C; // 12
+ }
+ if (n == 13) {
+ Led= 0x0D; // 13
+ }
+ if (n == 14) {
+ Led= 0x0E; // 14
+ }
+ if (n == 15) {
+ Led= 0x0F; // 15
+ }
+ }
+}
\ No newline at end of file