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.
Diff: main.cpp
- Revision:
- 0:33c425e06a2c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Wed Oct 03 00:42:11 2018 +0000
@@ -0,0 +1,50 @@
+#include "mbed.h"
+#include "TextLCD_20X4.h"
+#include "Keypad.h"
+
+Keypad kpad(D0,D1,D2,D3,D4,D5,D6,D7);
+TextLCD_20X4 lcd(PTC7,PTC0,PTC3,PTC4,PTC5,PTC6,PTC10,PTC11); // rs, e, d0, d1, d2, d3
+
+int main() {
+ char key;
+ int tecla=0;
+ lcd.cls();
+ lcd.locate(0,0);
+ lcd.printf("bienvenido ");
+ wait_ms(2000);
+
+ while(1) {
+
+ // lcd.cls();
+ lcd.locate(0,0);
+ lcd.printf(" digite la presion ");
+
+ key=kpad.ReadKey();//Lectura del teclado
+ tecla=key-48;
+ if (tecla==1){
+ lcd.cls();
+ lcd.locate(1,1);
+ lcd.printf("20 psi ");
+ }
+
+ if(tecla==2){
+ lcd.cls();
+ lcd.locate(0,1);
+ lcd.printf("40 psi ");
+ }
+
+ if(tecla==3){
+
+ lcd.cls();
+ lcd.locate(0,1);
+ lcd.printf("60 psi");
+ }
+ if(key=='4'){
+ lcd.cls();
+ lcd.locate(0,1);
+ lcd.printf("80 psi");
+
+ }
+ }
+ }
+