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: LCD_ka.cpp
- Revision:
- 0:4a5c6f06b26c
- Child:
- 1:d5b85bc9e87b
diff -r 000000000000 -r 4a5c6f06b26c LCD_ka.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/LCD_ka.cpp Wed Mar 25 19:24:43 2020 +0000
@@ -0,0 +1,58 @@
+
+#include "LCD_ka.h"
+
+DigitalOut RS(D8);
+DigitalOut E(D9);
+BusOut dados(D4, D5, D6, D7);
+
+void bate_enable(void){
+ E = 1;
+ wait(0.002);
+ E=0;
+ wait(0.002);
+}
+
+void Inicia_LCD(void){
+ wait(0.15);
+ RS = 0;
+ E = 0;
+
+ dados = 0x2;
+ bate_enable();
+ dados = 0x8;
+ bate_enable();
+
+ dados = 0x0;
+ bate_enable();
+ dados = 0xE;
+ bate_enable();
+
+ dados = 0x0;
+ bate_enable();
+ dados = 0x1;
+ bate_enable();
+}
+
+
+void disp(char *value){
+
+ for (int i = 0; value[i] != '\0';++i){
+ RS = 1;
+ wait(0.002);
+ char txt = value[i];
+ dados = txt>>4;
+ bate_enable();
+ dados = txt;
+ bate_enable();
+ RS = 0;
+ }
+}
+
+
+void clc(void){
+ wait(0.002);
+ dados = 0x0;
+ bate_enable();
+ dados = 0x1;
+ bate_enable();
+}