|
|
This document is available in: English ChineseGB Francais |
by Guido Socher (homepage) 关于作者: Guido喜欢Linux,因为对于开发自己的硬件来说,Linux确实是一个很好的系统。 目录: |
lcdproc -- 使LCD显示屏容易使用和制作摘要:
期望能读到关于微控制器的文章的读者应该不用担心。我一定会继续写的。
我的下一篇文章将还是关于微控制器的,同时我也做了一个网页,
你可以在下面地址找到所有最近电子方面的文章:
http://www.tuxgraphics.org/electronics/ |
#!/usr/bin/perl -w .... # initiate the communication: print $remote "hello\n"; .... # set our name and define a text string widget print $remote "client_set name lcdtime\n"; print $remote "screen_add scr1\n"; print $remote "widget_add scr1 str1 string\n"; .... while(1) { .... $date = scalar localtime; # now write to the LCD: print $remote "widget_set scr1 str1 1 1 \"$date\"\n"; sleep 10; }非常简单是吧?那么接下来让我们来做一些更有用的东西。
Parallel port pin 1 , strobe = 220, supply voltage pin 2 , D0 = LCD pin D4 pin 3 , D1 = LCD pin D5 pin 4 , D2 = LCD pin D6 pin 5 , D3 = LCD pin D7 pin 6 , D4 = LCD pin RS pin 7 , D5 = LCD pin RW pin 8 , D6 = LCD pin EN pin 10, ACK = button A, upper red button pin 12, PE = button C, lower black button pin 14, strobe = 220, supply voltage pin 16, strobe = 220, supply voltage pin 17, strobe = 220, supply voltage pin 18, ground = 0V, GND
tar zxvf lcdproc-0.4.5.tar.gz cd lcdproc-0.4.5 patch -p 1 < lcdproc-0.4.5-pp-powerpatch-v1.txt ./configure --enable-drivers=hd44780 make make install (或者你只需要将LCDd.conf拷贝到/etc,并将sever/LCDd拷贝到/usr/bin)
[server] Driver=HD44780 [HD44780] # Hitachi HD44780 driver Port=0x3BC # Port where the LPT is. Usual values are 0x278, 0x378 and 0x3BC ConnectionType=4bit Keypad=yes Backlight=no Size=20x2 # Specifies the size of the LCD. DelayMult=4 DelayBus=true比较困难的部分是端口地址(0x278, 0x378和0x3BC)。如何才能知道你并口的IO地址呢? 最简单的办法是装入parport内核模块(modprobe parport),然后查看/proc/ioports
modprobe parport modprobe parport_pc cat /proc/ioports ... 0388-0389 : OPL2/3 (left) 038a-038b : OPL2/3 (right) 03bc-03be : parport0 03c0-03df : vga+ 03f6-03f6 : ide0 ... 在这个例子中你可以使用: 0x3bc
主页由LinuxFocus编辑组维护
© Guido Socher "some rights reserved" see linuxfocus.org/license/ http://www.LinuxFocus.org |
翻译信息:
|
2005-04-28, generated by lfparser version 2.52