Mahandra Raditya / Mbed 2 deprecated LCDKEYPADTEST2

Dependencies:   TextLCD mbed

Files at this revision

API Documentation at this revision

Comitter:
Sunastra
Date:
Thu Nov 02 10:05:21 2017 +0000
Commit message:
Simple LCD test with button commands

Changed in this revision

TextLCD.lib Show annotated file Show diff for this revision Revisions of this file
main.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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TextLCD.lib	Thu Nov 02 10:05:21 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/TextLCD/#308d188a2d3a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Nov 02 10:05:21 2017 +0000
@@ -0,0 +1,70 @@
+
+// https://www.youtube.com/watch?v=yScO_v7NUYQ 
+// LEITURA DE BOTÕES
+
+#include "mbed.h"
+#include "TextLCD.h"
+
+
+//FRDM-K64F
+//TextLCD lcd(PTA0,PTC4,PTB23,PTA2,PTC2,PTC3); // rs, e, d4-d7
+TextLCD lcd(D8, D9, D4, D5, D6, D7); // rs, e, d4-d7
+Ticker      t;
+
+
+                
+AnalogIn Sensor(PTB2); //ESPECIFICA O PINO DE LEITURA ANALOGICA PARA FRDM-K64F 
+
+int main() {
+    
+    lcd.printf(" Calibration \n FRDM-K64F");
+    wait(3);   
+    lcd.cls();                                                      // Clean the display
+    
+        while(1){ 
+        wait(1); 
+        //lcd.locate(0,1);
+        //float x=Sensor.read_u16(); 
+        //lcd.printf("Value:(%f)",x);
+        
+        
+            if(Sensor.read_u16()>12000 && Sensor.read_u16()< 15000){
+               lcd.printf("Procedure \n will start");
+               wait(3);
+               lcd.cls(); 
+               lcd.printf(" * Relax * ");
+               wait(5);
+               lcd.cls(); 
+               lcd.printf(" * Stretch * ");
+               wait(4);
+               lcd.cls();                
+                } 
+                
+            if(Sensor.read_u16()>46000 && Sensor.read_u16()< 48000){
+               lcd.printf(" * left * ");
+               wait(1);
+               lcd.cls();                
+                } 
+                
+            if(Sensor.read_u16()>30000 && Sensor.read_u16()< 32000){
+               lcd.printf("  * down * ");
+               wait(1);
+               lcd.cls();                
+                } 
+                
+            if(Sensor.read_u16()>0 && Sensor.read_u16()< 10000){
+               lcd.printf("  * right * ");
+               wait(1);
+               lcd.cls();                       
+                }  
+                
+            else {
+                lcd.printf("Press to start", Sensor.read_u16());
+            wait(1);        
+            lcd.cls();
+            }
+                   
+                                        
+        }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Nov 02 10:05:21 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/fb8e0ae1cceb
\ No newline at end of file