买了一个Psoc3/5 DVK板子,刚开始学习,想实现段式LCD的显示,可是把程序下载到里面,显示屏出现了很模糊的字体,基本看不清楚,并且没有显示想要显示的字符啊。。有哪位大哥指点指点。。不胜感激。。
#include <device.h>
void main()
{
/*启动段式LCD,清屏*/
LCD_Seg_Start();
LCD_Seg_ClearDisplay();
while(1)
{
LCD_Seg_WriteString14Seg_1("PSoC",0); /*在LCD上显示“PSoC”消息*/
CyDelay(1000);/*延迟1秒*/
/*写S1,S2,S3,S4和S5像素*/
LCD_Seg_WritePixel(LCD_Seg_S1,1);
LCD_Seg_WritePixel(LCD_Seg_S2,1);
LCD_Seg_WritePixel(LCD_Seg_S3,1);
LCD_Seg_WritePixel(LCD_Seg_S4,1);
LCD_Seg_WritePixel(LCD_Seg_S5,1);
CyDelay(1000);/*延迟1秒*/
LCD_Seg_WriteString14Seg_1("LCD SEG",0);/*在LCD上显示“LCD SEG”消息*/
CyDelay(1000);/*延迟1秒*/
/*打开T5和T7的像素*/
LCD_Seg_WritePixel(LCD_Seg_T7,1);
LCD_Seg_WritePixel(LCD_Seg_T5,1);
LCD_Seg_WritePixel(LCD_Seg_T6,1);
CyDelay(1000);/*延迟1秒*/
LCD_Seg_WriteString14Seg_1("EBK",0);/*在LCD上显示“EBK”消息*/
CyDelay(1000);/*延迟1秒*/
/*在7段上显示数字*/
LCD_Seg_Write7SegDigit_0(8,0);
LCD_Seg_Write7SegDigit_0(8,1);
LCD_Seg_Write7SegDigit_0(8,2);
LCD_Seg_Write7SegDigit_0(8,3);
/*写COL3和COL4的像素*/
LCD_Seg_WritePixel(LCD_Seg_COL3,1);
LCD_Seg_WritePixel(LCD_Seg_COL4,1);
CyDelay(1000);/*延迟1秒*/
/*写T1,T2,T3和T4的像素*/
LCD_Seg_WritePixel(LCD_Seg_T1,1);
LCD_Seg_WritePixel(LCD_Seg_T4,1);
LCD_Seg_WritePixel(LCD_Seg_T2,1);
LCD_Seg_WritePixel(LCD_Seg_T3,1);
CyDelay(1000);/*延迟1秒*/
LCD_Seg_WriteString14Seg_1("PASSED",0);/*在LCD上显示“PASSED”消息*/
CyDelay(500);/*延迟0.5秒*/
/*写COL1和COL2的像素*/
LCD_Seg_WritePixel(LCD_Seg_COL1,1);
LCD_Seg_WritePixel(LCD_Seg_COL2,1);
CyDelay(500);/*延迟0.5秒*/
/*清除COL1和COL2的像素*/
LCD_Seg_WritePixel(LCD_Seg_COL1,0);
LCD_Seg_WritePixel(LCD_Seg_COL2,0);
CyDelay(500);/*延迟0.5秒*/
/*写COL1和COL2的像素*/
LCD_Seg_WritePixel(LCD_Seg_COL1,1);
LCD_Seg_WritePixel(LCD_Seg_COL2,1);
CyDelay(1000);/*延迟1秒*/
LCD_Seg_ClearDisplay();/*清除LCD显示*/
CyDelay(2000);/*延迟2秒*/
}
}
/* [] END OF FILE */ |