Aldo Omar Marez Aquino / Mbed 2 deprecated P5E1

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
aldomarez
Date:
Thu Nov 29 06:27:33 2018 +0000
Commit message:
Practica 5 Ejercicio 1

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Nov 29 06:27:33 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/e95d10626187
\ No newline at end of file