Aldo Omar Marez Aquino / Mbed 2 deprecated P5E1

Dependencies:   mbed

main.cpp

Committer:
aldomarez
Date:
2018-11-29
Revision:
0:82137a569230

File content as of revision 0:82137a569230:

#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
             }
    }
}