Gerardo CR
/
botonesfffffffffffffffffffffffffff
k
main.cpp@0:3fb63a3c606b, 2014-10-07 (annotated)
- Committer:
- gerardo_carmona
- Date:
- Tue Oct 07 15:46:30 2014 +0000
- Revision:
- 0:3fb63a3c606b
Primera prueba;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gerardo_carmona | 0:3fb63a3c606b | 1 | #include "mbed.h" |
gerardo_carmona | 0:3fb63a3c606b | 2 | |
gerardo_carmona | 0:3fb63a3c606b | 3 | DigitalOut myled(LED1); |
gerardo_carmona | 0:3fb63a3c606b | 4 | DigitalIn boton(D2); |
gerardo_carmona | 0:3fb63a3c606b | 5 | |
gerardo_carmona | 0:3fb63a3c606b | 6 | int main() { |
gerardo_carmona | 0:3fb63a3c606b | 7 | boton.mode(PullUp); |
gerardo_carmona | 0:3fb63a3c606b | 8 | while(1) { |
gerardo_carmona | 0:3fb63a3c606b | 9 | if (boton == 1){ |
gerardo_carmona | 0:3fb63a3c606b | 10 | myled = 1; |
gerardo_carmona | 0:3fb63a3c606b | 11 | } else { |
gerardo_carmona | 0:3fb63a3c606b | 12 | myled = 0; |
gerardo_carmona | 0:3fb63a3c606b | 13 | } |
gerardo_carmona | 0:3fb63a3c606b | 14 | } |
gerardo_carmona | 0:3fb63a3c606b | 15 | } |