Isaac Cruz
/
Practica_6_-_Ejercicio_02
Practica_6_-_Ejercicio_02
main.cpp@29:734b61eca6df, 2019-10-16 (annotated)
- Committer:
- isaacross99
- Date:
- Wed Oct 16 00:42:26 2019 +0000
- Revision:
- 29:734b61eca6df
- Parent:
- 28:868b283c5f77
- Child:
- 30:f7518060fc89
p4e7
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dan | 0:7dec7e9ac085 | 1 | #include "mbed.h" |
isaacross99 | 29:734b61eca6df | 2 | DigitalOut red(LED1); |
rgsbuap | 26:29f649949409 | 3 | Serial pc(USBTX,USBRX); |
isaacross99 | 29:734b61eca6df | 4 | DigitalIn boton1(PTC6); |
isaacross99 | 29:734b61eca6df | 5 | DigitalIn boton2(PTA4); |
isaacross99 | 29:734b61eca6df | 6 | int main(){ |
isaacross99 | 29:734b61eca6df | 7 | red=0; |
isaacross99 | 29:734b61eca6df | 8 | while(1){ |
isaacross99 | 29:734b61eca6df | 9 | /*while(boton1 || boton2){ |
isaacross99 | 29:734b61eca6df | 10 | red = 1; |
isaacross99 | 29:734b61eca6df | 11 | pc.printf("\nEstas presionando el boton :o"); |
isaacross99 | 29:734b61eca6df | 12 | } |
isaacross99 | 29:734b61eca6df | 13 | red=0;*/ |
isaacross99 | 29:734b61eca6df | 14 | //////////////////////////////////////////////////////////////////// |
isaacross99 | 29:734b61eca6df | 15 | if(!boton1 || !boton2){ |
isaacross99 | 29:734b61eca6df | 16 | red =1 ; |
isaacross99 | 29:734b61eca6df | 17 | pc.printf("\nEstas presionando el boton :o"); |
isaacross99 | 29:734b61eca6df | 18 | } |
isaacross99 | 29:734b61eca6df | 19 | else{ |
isaacross99 | 29:734b61eca6df | 20 | red=0; |
isaacross99 | 29:734b61eca6df | 21 | } |
isaacross99 | 28:868b283c5f77 | 22 | } |
isaacross99 | 28:868b283c5f77 | 23 | } |