Cielo Benítez / Mbed 2 deprecated Prac4_ejer6

Dependencies:   mbed

Committer:
cielo
Date:
Sun Apr 12 04:36:39 2020 +0000
Revision:
3:3bd2bf8416c8
Parent:
1:6554c60faa06
Do while

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bcostm 0:d5bd863b2036 1 #include "mbed.h"
cielo 3:3bd2bf8416c8 2 //led parpadeante
cielo 3:3bd2bf8416c8 3 DigitalOut led(LED2);
cielo 3:3bd2bf8416c8 4 DigitalIn push1(SW2);
cielo 3:3bd2bf8416c8 5 DigitalIn push2(SW3);
cielo 3:3bd2bf8416c8 6 Serial com1(USBTX,USBRX); // PARA USAR LOS PINES UART
bcostm 0:d5bd863b2036 7 int main()
bcostm 0:d5bd863b2036 8 {
cielo 3:3bd2bf8416c8 9
cielo 3:3bd2bf8416c8 10 do {
cielo 3:3bd2bf8416c8 11 led = 1; // LED is ON 1
cielo 3:3bd2bf8416c8 12 wait(0.3); // 300 ms
bcostm 1:6554c60faa06 13 led = 0; // LED is OFF
cielo 3:3bd2bf8416c8 14 wait(0.3); //300 ms
cielo 3:3bd2bf8416c8 15 led = 1; // 2
cielo 3:3bd2bf8416c8 16 wait(0.3);
cielo 3:3bd2bf8416c8 17 led = 0;
cielo 3:3bd2bf8416c8 18 wait(0.3);
cielo 3:3bd2bf8416c8 19 led = 1; //3
cielo 3:3bd2bf8416c8 20 wait(0.3);
cielo 3:3bd2bf8416c8 21 led = 0;
cielo 3:3bd2bf8416c8 22 wait(0.3);
cielo 3:3bd2bf8416c8 23 led = 1; //4
cielo 3:3bd2bf8416c8 24 wait(0.3);
cielo 3:3bd2bf8416c8 25 led = 0;
cielo 3:3bd2bf8416c8 26 wait(0.3);
cielo 3:3bd2bf8416c8 27 led = 1; // 5
cielo 3:3bd2bf8416c8 28 wait(0.3);
cielo 3:3bd2bf8416c8 29 led = 0;
cielo 3:3bd2bf8416c8 30 wait(0.5);
cielo 3:3bd2bf8416c8 31
cielo 3:3bd2bf8416c8 32 }
cielo 3:3bd2bf8416c8 33 while((push1==1)&&(push2==1));
bcostm 0:d5bd863b2036 34 }