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.
Dependencies: mbed
Revision 2:016bda11f251, committed 2018-03-05
- Comitter:
- afm76
- Date:
- Mon Mar 05 02:54:22 2018 +0000
- Parent:
- 1:c07bb4813cc3
- Commit message:
- Nucleo_Joystick_Shield V2.4 Xinda
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Mar 05 01:54:32 2018 +0000
+++ b/main.cpp Mon Mar 05 02:54:22 2018 +0000
@@ -14,32 +14,45 @@
Serial pc(USBTX, USBRX);
int main() {
-int i;
+int i,a,b,c,d,e,f;
pc.baud(9600);
-
-pc.printf("Hello World!!!\n\r");
+
+a=b=c=d=e=f=0;
+//b=0,
+//c=0,
+//d=0,
+//e=0,
+//f=0;
+pc.printf("\f\rA=%d, B=%d, C=%d, D=%d, E=%d, F=%d",a,b,c,d,e,f);
+pc.printf("\n\rHello World!!!");
while(1) {
- if (botao_A == 0) { // Botão usuário pressionado
- pc.printf("\n\rTecla A");
+ if (botao_A == 0) { // Botão usuário pressionado
+ a++;
+ pc.printf("\n\rTecla A = %d",a);
}
if (botao_B == 0) { // Botão externo pressionado
- pc.printf("\n\rTecla B");
+ b++;
+ pc.printf("\n\rTecla B = %d",b);
}
- if (botao_C == 0) { // Botão usuário pressionado
- pc.printf("\n\rTecla C");
+ if (botao_C == 0) { // Botão usuário pressionado
+ c++;
+ pc.printf("\n\rTecla C = %d",c);
}
- if (botao_D == 0) { // Botão usuário pressionado
- pc.printf("\n\rTecla D");
+ if (botao_D == 0) { // Botão usuário pressionado
+ d++;
+ pc.printf("\n\rTecla D = %d",d);
}
- if (botao_E == 0) { // Botão usuário pressionado
- pc.printf("\n\rTecla E");
+ if (botao_E == 0) { // Botão usuário pressionado
+ e++;
+ pc.printf("\n\rTecla E = %d",e);
}
- if (botao_F == 0) { // Botão usuário pressionado
- pc.printf("\n\rTecla F");
+ if (botao_F == 0) { // Botão usuário pressionado
+ f++;
+ pc.printf("\n\rTecla F = %d",f);
}
-
- for (i = 10; i < 100; i+=10){}
+// for (i = 1; i < 1000000; i+=1){}
+ wait(0.2);
}
}