Ejercicio 3 práctica 2
Dependencies: mbed
main.cpp@0:7005b985c781, 2018-10-18 (annotated)
- Committer:
- Javier001
- Date:
- Thu Oct 18 10:45:17 2018 +0000
- Revision:
- 0:7005b985c781
sdfsdf
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Javier001 | 0:7005b985c781 | 1 | #include "mbed.h" |
Javier001 | 0:7005b985c781 | 2 | DigitalIn boton(PC_13); |
Javier001 | 0:7005b985c781 | 3 | int main() |
Javier001 | 0:7005b985c781 | 4 | { |
Javier001 | 0:7005b985c781 | 5 | int contador =0; |
Javier001 | 0:7005b985c781 | 6 | while(1) { |
Javier001 | 0:7005b985c781 | 7 | contador++; |
Javier001 | 0:7005b985c781 | 8 | if(boton==0) { |
Javier001 | 0:7005b985c781 | 9 | printf("El contador vale %d\n",contador); |
Javier001 | 0:7005b985c781 | 10 | } |
Javier001 | 0:7005b985c781 | 11 | wait(0.10); |
Javier001 | 0:7005b985c781 | 12 | } |
Javier001 | 0:7005b985c781 | 13 | } |