Teste i/o freedom kl25z

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
PedroS1989
Date:
Tue Mar 17 23:42:24 2015 +0000
Commit message:
Teste_i_o_freedom_kl25z_leds_and_button

Changed in this revision

main_treste_i_o.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r ca574fffad51 main_treste_i_o.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main_treste_i_o.cpp	Tue Mar 17 23:42:24 2015 +0000
@@ -0,0 +1,51 @@
+//AUTOR: Pedro Santos
+//DATA: 18/12/2014
+//NOTAS: http:
+//CODIGO PARA: programa de teste para entradas e saidas da placa kl25Z
+
+#include "mbed.h"
+
+//********************************************************************
+//********************************************************************
+//DEFINIÇÃO DE ENTRADAS E SAIDAS USADAS NO PROGRAMA
+//SAIDAS DIGITAIS
+DigitalOut  led1     (PTE2);
+DigitalOut  led2     (PTE3);
+DigitalOut  led3     (PTE4);
+DigitalOut  led4     (PTE5);
+
+//ENTRADAS DIGITAIS
+DigitalIn tecla1 (PTE20);
+DigitalIn tecla2 (PTE21);
+DigitalIn tecla3 (PTE22);
+DigitalIn tecla4 (PTE23);
+
+
+
+//********************************************************************
+//****************************** MAIN ********************************
+//********************************************************************
+int main() {  
+  
+//****************************** LOOP ********************************
+    while(1) {
+
+        led2 = 0;
+        wait(0.1); //Wait 100ms
+        led2 = 1;
+        wait(0.1); //Wait 100ms
+        
+        //testa tecla 1 e 2
+        if(tecla1==1 || tecla2==1)
+            led3=1;
+        else
+            led3=0;
+            
+         //testa tecla 3 e 4
+        if(tecla3==1 || tecla4==1)
+            led4=1;
+        else
+            led4=0;                   
+           
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r ca574fffad51 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Mar 17 23:42:24 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/7e07b6fb45cf
\ No newline at end of file