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@27:dd66bc613818, 2020-04-11 (annotated)
- Committer:
- thesad
- Date:
- Sat Apr 11 01:43:08 2020 +0000
- Revision:
- 27:dd66bc613818
- Parent:
- 26:e38cccb546f9
- Child:
- 28:af7497eec9b6
Mis primeras practicas.2;
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| thesad | 26:e38cccb546f9 | 1 | #include "mbed.h" |
| thesad | 27:dd66bc613818 | 2 | #include<conio.h> |
| thesad | 26:e38cccb546f9 | 3 | |
| thesad | 26:e38cccb546f9 | 4 | |
| thesad | 27:dd66bc613818 | 5 | Serial takataka(USBTX, USBRX); |
| thesad | 27:dd66bc613818 | 6 | |
| thesad | 27:dd66bc613818 | 7 | #define KEY_R 82 |
| thesad | 27:dd66bc613818 | 8 | #define KEY_Q 81 |
| thesad | 27:dd66bc613818 | 9 | #define HEY_S 83 |
| thesad | 27:dd66bc613818 | 10 | #define KEY_P 80 |
| thesad | 27:dd66bc613818 | 11 | #define KEY_1 49 |
| thesad | 27:dd66bc613818 | 12 | #define KEY_2 50 |
| thesad | 27:dd66bc613818 | 13 | #define KEY_3 51 |
| thesad | 27:dd66bc613818 | 14 | #define KEY_4 52 |
| thesad | 27:dd66bc613818 | 15 | #define KEY_5 53 |
| thesad | 27:dd66bc613818 | 16 | #define KEY_9 57 |
| thesad | 27:dd66bc613818 | 17 | #define KEY_ESC 27 |
| thesad | 27:dd66bc613818 | 18 | |
| dan | 0:7dec7e9ac085 | 19 | |
| thesad | 26:e38cccb546f9 | 20 | int main() |
| thesad | 26:e38cccb546f9 | 21 | { |
| thesad | 27:dd66bc613818 | 22 | char: cha; |
| thesad | 26:e38cccb546f9 | 23 | |
| thesad | 27:dd66bc613818 | 24 | takataka.printf("Escoge uno: 1, 2, 3, 4, 5, R, P, Q, 9, S \n ESC para salir\n"); |
| thesad | 27:dd66bc613818 | 25 | cha=getchar(); |
| dan | 0:7dec7e9ac085 | 26 | |
| thesad | 27:dd66bc613818 | 27 | |
| thesad | 27:dd66bc613818 | 28 | while(value != KEY_ESC){ |
| thesad | 26:e38cccb546f9 | 29 | |
| thesad | 26:e38cccb546f9 | 30 | |
| thesad | 27:dd66bc613818 | 31 | switch(cha){ |
| thesad | 26:e38cccb546f9 | 32 | |
| thesad | 27:dd66bc613818 | 33 | case 'p':takataka.puts("Paseme profe :D \n\n"); |
| thesad | 27:dd66bc613818 | 34 | break; |
| thesad | 26:e38cccb546f9 | 35 | |
| thesad | 27:dd66bc613818 | 36 | case 'R':takataka.puts("RUSSIAN MODE ACTIVED \n\n"); |
| thesad | 27:dd66bc613818 | 37 | break; |
| thesad | 26:e38cccb546f9 | 38 | |
| thesad | 27:dd66bc613818 | 39 | case 'q':takataka.puts("Quiero pasar profe :c \n\n"); |
| thesad | 27:dd66bc613818 | 40 | break; |
| thesad | 26:e38cccb546f9 | 41 | |
| thesad | 27:dd66bc613818 | 42 | case 's':takataka.puts("SALVE RUSSIA \n\n"); |
| thesad | 27:dd66bc613818 | 43 | break; |
| thesad | 26:e38cccb546f9 | 44 | |
| thesad | 27:dd66bc613818 | 45 | case 1:takataka.puts("1-2 freddy viene por ti \n\n"); |
| thesad | 27:dd66bc613818 | 46 | break; |
| rgsbuap | 25:c4eed8baa6d3 | 47 | |
| thesad | 27:dd66bc613818 | 48 | case 2:takataka.puts("3-4 cierra la puerta \n\n"); |
| thesad | 27:dd66bc613818 | 49 | break; |
| thesad | 26:e38cccb546f9 | 50 | |
| thesad | 27:dd66bc613818 | 51 | case 3:takataka.puts("5-6 coje un crucifijo \n\n"); |
| thesad | 27:dd66bc613818 | 52 | break; |
| thesad | 26:e38cccb546f9 | 53 | |
| thesad | 27:dd66bc613818 | 54 | case 4:takataka.puts("7-8 mantente despierto \n\n"); |
| thesad | 27:dd66bc613818 | 55 | break; |
| thesad | 26:e38cccb546f9 | 56 | |
| thesad | 27:dd66bc613818 | 57 | case 5:takataka.puts("9-10 nunca mas dormiras \n\n"); |
| thesad | 27:dd66bc613818 | 58 | break; |
| thesad | 26:e38cccb546f9 | 59 | |
| thesad | 27:dd66bc613818 | 60 | case 9:takataka.puts("Pasenos con esa calificación :D \n\n"); |
| thesad | 27:dd66bc613818 | 61 | break; |
| thesad | 27:dd66bc613818 | 62 | default: puts("Error"); |
| thesad | 26:e38cccb546f9 | 63 | |
| thesad | 27:dd66bc613818 | 64 | } |
| thesad | 27:dd66bc613818 | 65 | |
| thesad | 27:dd66bc613818 | 66 | } |
| thesad | 27:dd66bc613818 | 67 | } |
| thesad | 26:e38cccb546f9 | 68 | } |