Learned how to use LCD to display two lines of email and phone number
Three display modes:
direct display,
scrolling display
, flashing display,
simulation schematic diagram as follows,
single chip source program as follows:
#include
sbit rs=P2^0;
sbit rw=P2^1;
sbit en=P2^2;
#define uint unsigned int
#define uchar unsigned char
uchar code tab1[]={"123456@163.com"};
uchar code tab2[]={"tel:1234567891"};
void delay(unsigned int xms);
void write_com(uchar com)
{
rw=0;
rs=0;//instruction register
P0=com;
delay(5); en
=1;
delay(5);
en=0;
}
void write_data(uchar dat)
{
rw=0;
rs=1;//data register
P0=dat;
delay(5);
en=1;
delay(5);
en=0;
}
void init()
{
en=0;
write_com(0x01);
write_com(0x06);
write_com(0x0c);
write_com(0x38);
}
int main()
{
uint i;
init();
write_com(0x80+0x10);
for(i=0;i<15;i++)
{
write_data(tab1[ i]);
delay(50);
}
write_com(0x80+0x50);
for(i=0;i<15;i++)
{
write_data(tab2[ i]);
delay(50);
}
while(1)
{
for(i=0;i<16;i++)
{
write_com(0x1c);
delay(50);
}
}
return 0;
}
void delay(unsigned int xms)
{
unsigned i,j;
for(i=xms;i>0;i--)
for(j=110;j>0;j--);
}
Previous article:Programming of Human Infrared Alarm Based on 51 Single Chip Microcomputer
Next article:Proteus simulation and source program design of single chip temperature control fan
Recommended ReadingLatest update time:2024-11-16 12:48
- Popular Resources
- Popular amplifiers
- Single-chip microcomputer C language programming and simulation
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
- Principles and Applications of Single Chip Microcomputers and C51 Programming (3rd Edition) (Xie Weicheng, Yang Jiaguo)
- stm32+lcd1602 example
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- What is the difference between cmw500 signaling and non-signaling?
- MSP430 MCU Development Record (2)
- [MM32 eMiniBoard Review] + OLED screen driver display
- How to speed up pmos shutdown and control the delay time within us
- I would like to ask if the experts know the component library resources of 3554am in ad... I downloaded many component libraries but couldn't find it
- Questions about the use of TL431
- The development history of Chinese radio
- Cost-effective ADC evaluation board, EVAL-AD7606C-18
- Qorvo simplifies Wi-Fi 6E with first FEM to support 5.1 to 7.1 GHz frequency bands in a single module ...
- [RVB2601 Creative Application Development] Alibaba Cloud Testing