|
发表于 23-12-2010 08:22 AM
|
显示全部楼层
回复 20# choon1988
- #include <string.h>
- unsigned char TOASCII(unsigned char Data)
- {
- if(Data<0x0A) return (Data+0x30);
- else return(Data+0x37);
- }
- void BYTE2ASCII(unsigned char *Dest, unsigned char *Source , unsigned int size )
- {
- unsigned int index = 0;
- for( index = 0; index < size; index++)
- {
- Dest[index*2+0] = TOASCII(((Source[index]&0xF0)>> 4));
- Dest[index*2+1] = TOASCII((Source[index]&0x0F));
- }
- }
- void Conv_BYTE2ASCII(unsigned char KeyVal)
- {
- unsigned char MSG[10];
- memset (MSG,0x00,sizeof(MSG));
- BYTE2ASCII(MSG,&KeyVal,1);
- LCD_sendstring(MSG);
- }
复制代码
那么就用这组代码吧,修改过的!2楼那个代码少了这个函数 unsigned char TOASCII(unsigned char Data)。
void BYTE2ASCII(unsigned char *Dest, unsigned char *Source , unsigned int size ), 的“Dest” 是回传转换好的string,“Source”是要转换的值,“size”是指有多少个data byte 要转换。 |
|
|
|
|
|
|
|

楼主 |
发表于 23-12-2010 02:00 PM
|
显示全部楼层
回复 choon1988
那么就用这组代码吧,修改过的!2楼那个代码少了这个函数 unsigned char TOASCII( ...
wkloh 发表于 23-12-2010 08:22 AM 
所以display出来的是HEX?那我试下convert去decimal.. |
|
|
|
|
|
|
|
发表于 23-12-2010 03:05 PM
|
显示全部楼层
回复 22# choon1988
不好意思,给出代码!那个代码是用来显示hex to string。
用下面这个试试看吧!如果 KeyVal=55 或 KeyVal=0x37,LCD会显示‘055’。
- void Conv_BYTE2ASCII(unsigned char KeyVal)
- {
- unsigned char MSG[10];
- memset (MSG,0x00,sizeof(MSG));
-
- MSG[2]=(KeyVal % 10)+'0';
- MSG[1]=((KeyVal/10) % 10)+'0';
- MSG[0]=((KeyVal/100) % 10)+'0';
- LCD_sendstring(MSG);
- }
复制代码
接下来你的挑战是写个程式,
如何判断MSG[0]='0时是不做显示的! |
|
|
|
|
|
|
|

楼主 |
发表于 23-12-2010 03:47 PM
|
显示全部楼层
回复 choon1988
不好意思,给出代码!那个代码是用来显示hex to string。
用下面这个试试看吧!如果 ...
wkloh 发表于 23-12-2010 03:05 PM 
感激...
看来我的programming还有很长的路要走..
不过我会用心学的,我要继续把它改去我要的code了..
谢谢wkloh和fritlizt的帮忙... |
|
|
|
|
|
|
|
发表于 23-12-2010 11:06 PM
|
显示全部楼层
楼主,你是哪里的学生!方便公开吗。。。
想了解,现在还有教8051的学府有多少间。。。 |
|
|
|
|
|
|
|
发表于 23-12-2010 11:07 PM
|
显示全部楼层
楼主,你是哪里的学生!方便公开吗。。。
想了解,现在还有教8051的学府有多少间。。。 |
|
|
|
|
|
|
|

楼主 |
发表于 24-12-2010 03:30 AM
|
显示全部楼层
楼主,你是哪里的学生!方便公开吗。。。
想了解,现在还有教8051的学府有多少间。。。
wkloh 发表于 23-12-2010 11:06 PM 
mmu... |
|
|
|
|
|
|
|
发表于 25-12-2010 11:54 PM
|
显示全部楼层
本帖最后由 wkloh 于 25-12-2010 11:57 PM 编辑
楼主,为什麽会想用这个芯片AT89C51ED2。
你的LCD Queuing System开发到什么样功能,需要用到一下芯片功能:
1. 2K EEPROM
2. 2K RAM
3. 64K Program Flash
4. 6clock/machine cycle。
5. SPI (Master/Slave)。
这颗芯片不便宜哦。。。 |
|
|
|
|
|
|
|

楼主 |
发表于 26-12-2010 01:01 AM
|
显示全部楼层
楼主,为什麽会想用这个芯片AT89C51ED2。
你的LCD Queuing System开发到什么样功能,需要用到一下芯片功 ...
wkloh 发表于 25-12-2010 11:54 PM 
其实我做的不是queuing system,只是有其中一part是需要到如何把stored data显示出来的功能,所以那个queuing system只是testing来得.. |
|
|
|
|
|
|
|
发表于 26-12-2010 10:18 AM
|
显示全部楼层
其实我做的不是queuing system,只是有其中一part是需要到如何把stored data显示出来的功能,所以那个q ...
choon1988 发表于 26-12-2010 01:01 AM 
能简易的介绍你的project用途吗!
AT89C51ED2除了做LCD display之外,还有做什么控制啊!好奇想知道一下。。。 |
|
|
|
|
|
|
|

楼主 |
发表于 27-12-2010 05:41 PM
|
显示全部楼层
能简易的介绍你的project用途吗!
AT89C51ED2除了做LCD display之外,还有做什么控制啊!好奇想知 ...
wkloh 发表于 26-12-2010 10:18 AM 
是做Auto Car Parking System..
车自动parking... |
|
|
|
|
|
|
|
发表于 27-12-2010 05:54 PM
|
显示全部楼层
是做Auto Car Parking System..
车自动parking...
choon1988 发表于 27-12-2010 05:41 PM 
用conveyer,系统自动安排把车送到parking位的那种吗!
LCD display主要功能是安装在哪个部分。。。 |
|
|
|
|
|
|
| |
本周最热论坛帖子
|