Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp@7:f313fb383b37, 2020-04-24 (annotated)
- Committer:
- akumagame
- Date:
- Fri Apr 24 23:13:33 2020 +0000
- Revision:
- 7:f313fb383b37
- Parent:
- 6:14523b016fd5
f
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
akumagame | 0:fe1cbc83cf4c | 1 | #include "mbed.h" |
akumagame | 0:fe1cbc83cf4c | 2 | |
akumagame | 0:fe1cbc83cf4c | 3 | |
akumagame | 0:fe1cbc83cf4c | 4 | Serial com1(USBTX, USBRX); |
akumagame | 0:fe1cbc83cf4c | 5 | |
akumagame | 7:f313fb383b37 | 6 | DigitalIn bot(PTC6); |
akumagame | 5:45bfe4a9d0a0 | 7 | |
akumagame | 7:f313fb383b37 | 8 | void boton(int bar) |
akumagame | 7:f313fb383b37 | 9 | { |
akumagame | 7:f313fb383b37 | 10 | |
akumagame | 7:f313fb383b37 | 11 | if(bar==0) |
akumagame | 4:87dc862ec3aa | 12 | { |
akumagame | 7:f313fb383b37 | 13 | com1.printf("El boton esta siendo presionado\n"); |
akumagame | 0:fe1cbc83cf4c | 14 | |
akumagame | 0:fe1cbc83cf4c | 15 | } |
akumagame | 0:fe1cbc83cf4c | 16 | |
akumagame | 0:fe1cbc83cf4c | 17 | else |
akumagame | 0:fe1cbc83cf4c | 18 | { |
akumagame | 7:f313fb383b37 | 19 | com1.printf("El boton esta no esta siendo presionado\n" ); |
akumagame | 0:fe1cbc83cf4c | 20 | |
akumagame | 0:fe1cbc83cf4c | 21 | } |
akumagame | 6:14523b016fd5 | 22 | |
akumagame | 7:f313fb383b37 | 23 | |
akumagame | 0:fe1cbc83cf4c | 24 | |
akumagame | 7:f313fb383b37 | 25 | } |
akumagame | 7:f313fb383b37 | 26 | |
akumagame | 7:f313fb383b37 | 27 | int main() |
akumagame | 7:f313fb383b37 | 28 | |
akumagame | 7:f313fb383b37 | 29 | { |
akumagame | 7:f313fb383b37 | 30 | while(1) |
akumagame | 7:f313fb383b37 | 31 | { |
akumagame | 7:f313fb383b37 | 32 | int x; |
akumagame | 7:f313fb383b37 | 33 | x = bot.read(); |
akumagame | 7:f313fb383b37 | 34 | boton(x); |
akumagame | 7:f313fb383b37 | 35 | |
akumagame | 7:f313fb383b37 | 36 | |
akumagame | 7:f313fb383b37 | 37 | |
akumagame | 7:f313fb383b37 | 38 | } |
akumagame | 0:fe1cbc83cf4c | 39 | } |
akumagame | 0:fe1cbc83cf4c | 40 | |
akumagame | 0:fe1cbc83cf4c | 41 |