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
main.cpp
00001 00002 00003 #include "mbed.h" 00004 00005 DigitalIn botao_A(D2); 00006 DigitalIn botao_B(D3); 00007 DigitalIn botao_C(D4); 00008 DigitalIn botao_D(D5); 00009 DigitalIn botao_E(D6); 00010 DigitalIn botao_F(D7); 00011 00012 DigitalOut myled(LED1); 00013 00014 Serial pc(USBTX, USBRX); 00015 00016 int main() { 00017 int i,a,b,c,d,e,f; 00018 pc.baud(9600); 00019 00020 a=b=c=d=e=f=0; 00021 //b=0, 00022 //c=0, 00023 //d=0, 00024 //e=0, 00025 //f=0; 00026 pc.printf("\f\rA=%d, B=%d, C=%d, D=%d, E=%d, F=%d",a,b,c,d,e,f); 00027 pc.printf("\n\rHello World!!!"); 00028 00029 while(1) { 00030 if (botao_A == 0) { // Botão usuário pressionado 00031 a++; 00032 pc.printf("\n\rTecla A = %d",a); 00033 } 00034 if (botao_B == 0) { // Botão externo pressionado 00035 b++; 00036 pc.printf("\n\rTecla B = %d",b); 00037 } 00038 if (botao_C == 0) { // Botão usuário pressionado 00039 c++; 00040 pc.printf("\n\rTecla C = %d",c); 00041 } 00042 if (botao_D == 0) { // Botão usuário pressionado 00043 d++; 00044 pc.printf("\n\rTecla D = %d",d); 00045 } 00046 if (botao_E == 0) { // Botão usuário pressionado 00047 e++; 00048 pc.printf("\n\rTecla E = %d",e); 00049 } 00050 if (botao_F == 0) { // Botão usuário pressionado 00051 f++; 00052 pc.printf("\n\rTecla F = %d",f); 00053 } 00054 // for (i = 1; i < 1000000; i+=1){} 00055 wait(0.2); 00056 } 00057 } 00058
Generated on Sun Jul 17 2022 21:06:26 by
1.7.2