Felix Pachay
/
Prueba_diodos
Probando_diodos
main.cpp@0:8b6588667f99, 2020-02-08 (annotated)
- Committer:
- fpachays
- Date:
- Sat Feb 08 19:26:33 2020 +0000
- Revision:
- 0:8b6588667f99
pruebas_diodos
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
fpachays | 0:8b6588667f99 | 1 | #include "mbed.h" |
fpachays | 0:8b6588667f99 | 2 | |
fpachays | 0:8b6588667f99 | 3 | DigitalOut myled(p5); |
fpachays | 0:8b6588667f99 | 4 | DigitalOut myled2(p6); |
fpachays | 0:8b6588667f99 | 5 | DigitalOut myled3(p7); |
fpachays | 0:8b6588667f99 | 6 | DigitalOut myled4(p8); |
fpachays | 0:8b6588667f99 | 7 | DigitalIn boton1(p9); |
fpachays | 0:8b6588667f99 | 8 | float dormir = 0.509; |
fpachays | 0:8b6588667f99 | 9 | |
fpachays | 0:8b6588667f99 | 10 | int main() { |
fpachays | 0:8b6588667f99 | 11 | |
fpachays | 0:8b6588667f99 | 12 | while(1) { |
fpachays | 0:8b6588667f99 | 13 | if(dormir == 0) { dormir = 1;} |
fpachays | 0:8b6588667f99 | 14 | if(boton1 & dormir != 0.01) { |
fpachays | 0:8b6588667f99 | 15 | dormir = (dormir - 0.01); |
fpachays | 0:8b6588667f99 | 16 | } |
fpachays | 0:8b6588667f99 | 17 | |
fpachays | 0:8b6588667f99 | 18 | myled = 1; |
fpachays | 0:8b6588667f99 | 19 | if(dormir == 0) { dormir = 1;} |
fpachays | 0:8b6588667f99 | 20 | |
fpachays | 0:8b6588667f99 | 21 | if(boton1 & dormir != 0.01) { |
fpachays | 0:8b6588667f99 | 22 | dormir = (dormir - 0.01); |
fpachays | 0:8b6588667f99 | 23 | } |
fpachays | 0:8b6588667f99 | 24 | |
fpachays | 0:8b6588667f99 | 25 | wait(dormir); |
fpachays | 0:8b6588667f99 | 26 | myled = 0; |
fpachays | 0:8b6588667f99 | 27 | if(dormir == 0) { dormir = 1;} |
fpachays | 0:8b6588667f99 | 28 | |
fpachays | 0:8b6588667f99 | 29 | if(boton1 & dormir != 0.01) { |
fpachays | 0:8b6588667f99 | 30 | dormir = (dormir - 0.01); |
fpachays | 0:8b6588667f99 | 31 | } |
fpachays | 0:8b6588667f99 | 32 | |
fpachays | 0:8b6588667f99 | 33 | wait(dormir); |
fpachays | 0:8b6588667f99 | 34 | myled2 = 1; |
fpachays | 0:8b6588667f99 | 35 | if(dormir == 0) { dormir = 1;} |
fpachays | 0:8b6588667f99 | 36 | |
fpachays | 0:8b6588667f99 | 37 | if(boton1 & dormir != 0.01) { |
fpachays | 0:8b6588667f99 | 38 | dormir = (dormir - 0.01); |
fpachays | 0:8b6588667f99 | 39 | } |
fpachays | 0:8b6588667f99 | 40 | |
fpachays | 0:8b6588667f99 | 41 | wait(dormir); |
fpachays | 0:8b6588667f99 | 42 | myled2 = 0; |
fpachays | 0:8b6588667f99 | 43 | if(dormir == 0) { dormir = 1;} |
fpachays | 0:8b6588667f99 | 44 | |
fpachays | 0:8b6588667f99 | 45 | if(boton1 & dormir != 0.01) { |
fpachays | 0:8b6588667f99 | 46 | dormir = (dormir - 0.01); |
fpachays | 0:8b6588667f99 | 47 | } |
fpachays | 0:8b6588667f99 | 48 | |
fpachays | 0:8b6588667f99 | 49 | wait(dormir); |
fpachays | 0:8b6588667f99 | 50 | myled3 = 1; |
fpachays | 0:8b6588667f99 | 51 | if(dormir == 0) { dormir = 1;} |
fpachays | 0:8b6588667f99 | 52 | |
fpachays | 0:8b6588667f99 | 53 | if(boton1 & dormir != 0.01) { |
fpachays | 0:8b6588667f99 | 54 | dormir = (dormir - 0.01); |
fpachays | 0:8b6588667f99 | 55 | } |
fpachays | 0:8b6588667f99 | 56 | |
fpachays | 0:8b6588667f99 | 57 | wait(dormir); |
fpachays | 0:8b6588667f99 | 58 | myled3 = 0; |
fpachays | 0:8b6588667f99 | 59 | |
fpachays | 0:8b6588667f99 | 60 | if(dormir == 0) { dormir = 1;} |
fpachays | 0:8b6588667f99 | 61 | |
fpachays | 0:8b6588667f99 | 62 | if(boton1 & dormir != 0.01) { |
fpachays | 0:8b6588667f99 | 63 | dormir = (dormir - 0.01); |
fpachays | 0:8b6588667f99 | 64 | } |
fpachays | 0:8b6588667f99 | 65 | |
fpachays | 0:8b6588667f99 | 66 | wait(dormir); |
fpachays | 0:8b6588667f99 | 67 | myled4 = 1; |
fpachays | 0:8b6588667f99 | 68 | if(dormir == 0) { dormir = 1;} |
fpachays | 0:8b6588667f99 | 69 | |
fpachays | 0:8b6588667f99 | 70 | if(boton1 & dormir != 0.01) { |
fpachays | 0:8b6588667f99 | 71 | dormir = (dormir - 0.01); |
fpachays | 0:8b6588667f99 | 72 | } |
fpachays | 0:8b6588667f99 | 73 | |
fpachays | 0:8b6588667f99 | 74 | wait(dormir); |
fpachays | 0:8b6588667f99 | 75 | myled4 = 0; |
fpachays | 0:8b6588667f99 | 76 | if(dormir == 0) { dormir = 1;} |
fpachays | 0:8b6588667f99 | 77 | |
fpachays | 0:8b6588667f99 | 78 | if(boton1 & dormir != 0.01) { |
fpachays | 0:8b6588667f99 | 79 | dormir = (dormir - 0.01); |
fpachays | 0:8b6588667f99 | 80 | } |
fpachays | 0:8b6588667f99 | 81 | |
fpachays | 0:8b6588667f99 | 82 | wait(dormir); |
fpachays | 0:8b6588667f99 | 83 | } |
fpachays | 0:8b6588667f99 | 84 | } |
fpachays | 0:8b6588667f99 | 85 | |
fpachays | 0:8b6588667f99 | 86 | |
fpachays | 0:8b6588667f99 | 87 | |
fpachays | 0:8b6588667f99 | 88 | |
fpachays | 0:8b6588667f99 | 89 | |
fpachays | 0:8b6588667f99 | 90 | |
fpachays | 0:8b6588667f99 | 91 | |
fpachays | 0:8b6588667f99 | 92 | |
fpachays | 0:8b6588667f99 | 93 | |
fpachays | 0:8b6588667f99 | 94 | |
fpachays | 0:8b6588667f99 | 95 | |
fpachays | 0:8b6588667f99 | 96 | |
fpachays | 0:8b6588667f99 | 97 | |
fpachays | 0:8b6588667f99 | 98 | |
fpachays | 0:8b6588667f99 | 99 | |
fpachays | 0:8b6588667f99 | 100 | |
fpachays | 0:8b6588667f99 | 101 | int main() { |
fpachays | 0:8b6588667f99 | 102 | while(1) { |
fpachays | 0:8b6588667f99 | 103 | myled = 1; |
fpachays | 0:8b6588667f99 | 104 | wait(0.2); |
fpachays | 0:8b6588667f99 | 105 | myled = 0; |
fpachays | 0:8b6588667f99 | 106 | wait(0.2); |
fpachays | 0:8b6588667f99 | 107 | } |
fpachays | 0:8b6588667f99 | 108 | } |