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
LCD.cpp
00001 #include "LCD.h" 00002 DigitalOut RS(D12); 00003 DigitalOut E(D11); 00004 BusOut data(D5,D4,D3,D2); 00005 void toggle_enable(void){ 00006 E=1; 00007 wait(0.001); 00008 E=0; 00009 wait(0.001); 00010 } 00011 void LCD_init(void){ 00012 wait(0.02); 00013 RS=0; 00014 E=0; 00015 data=0x2; 00016 toggle_enable(); 00017 data=0x8; 00018 toggle_enable(); 00019 data=0x0; 00020 toggle_enable(); 00021 data=0xF; 00022 toggle_enable(); 00023 data=0x0; 00024 toggle_enable(); 00025 data=0x1, 00026 toggle_enable(); 00027 } 00028 void display_to_LCD(char value){ 00029 RS=1; 00030 data=value>>4; 00031 toggle_enable(); 00032 data=value; 00033 toggle_enable(); 00034 } 00035 void set_location(char location){ 00036 data=(location|0x80)>>4; 00037 toggle_enable(); 00038 data=location&0x0F; 00039 toggle_enable(); 00040 } 00041 00042 00043
Generated on Mon Jul 18 2022 23:29:47 by
