液晶屏初始化
void lcdinit(void)
{
command1( 0x03 );
command1( 0x03 );
command1( 0x03 );
delay1(20);
command1( 0x02 ); //lcd home
delay1(10);
Command( 0x28 );
delay1(10);
Command( 0x08 ); //display of cursor off
delay1(10);
Command( 0x0C ); //display on and cursor off
delay1(10);
Command( 0x06 ); //shift cursor right
delay1(10);
Command( 0x01 ); //clear display screen
delay1(10);
问:我在atmega32上使用过lcd。我已经注释了我所知道的命令。未注释的命令是什么意思?
void lcdinit(void)
{
command1( 0x03 );
command1( 0x03 );
command1( 0x03 );
delay1(20);
command1( 0x02 ); //lcd home
delay1(10);
Command( 0x28 );
delay1(10);
Command( 0x08 ); //display of cursor off
delay1(10);
Command( 0x0C ); //display on and cursor off
delay1(10);
Command( 0x06 ); //shift cursor right
delay1(10);
Command( 0x01 ); //clear display screen
delay1(10);
Q: i have used lcd with atmega32.I have commented the commands which i know.Whats the meaning of uncommented commands ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
也许您应该查看 LCD 模块的数据表。它将向您显示它支持的命令集,或者至少为您提供在哪里可以找到该命令集的参考。
Perhaps you should look at the datasheet for your LCD module. It will show you the command set it supports or at least give you a reference on where you can find the command set.
这可能是 HD44780 兼容控制器(不幸的是我们不知道)
我认为 0x28 是功能集(4 位接口,2 行,5*7 像素)
0x03 命令是显示器初始化序列的一部分,然后是 20 毫秒的睡眠
this could be a HD44780 compatible controller (we dont know it, unfortunately)
i think 0x28 is Function set (4-bit interface, 2 lines, 5*7 Pixels)
the 0x03 commands are part of the initializing sequence of the display, followed by a sleep of 20 ms
这里是一些注释良好的 4 位 LCD 代码,包括初始化代码。它不是“AVR”C,但如果您将宏移植到它上面应该可以正常工作。
作为参考,“原始”HD44780 LCD 控制器数据表可在此处获取:http://crystalfontz.com/controllers /Hitachi/HD44780
(代码来自 https://forum.crystalfontz.com/showthread .php/6119)
Here is some well-commented 4-bit LCD code, including the initialization code. It is not "AVR" C but if you port the macros over it should work OK.
For reference, the "original" HD44780 LCD controller data sheet is available here: http://crystalfontz.com/controllers/Hitachi/HD44780
(code from from https://forum.crystalfontz.com/showthread.php/6119 )