一乐电子

 找回密码
 请使用微信账号登录和注册会员

QQ登录

只需一步,快速开始

微信扫码登录

手机号码,快捷登录

手机号码,快捷登录

搜索
楼主: iamusb

全新液晶屏3.5一片,10片包邮 特价3天 3天后恢复原价

[复制链接]
 楼主| 发表于 2015-6-2 11:51 | 显示全部楼层
jcdzxh 发表于 2015-6-2 11:21
再来一张中汉字效果凑人气

漂亮啊。比普通的12864效果好多了
回复

使用道具 举报

发表于 2015-6-2 12:59 | 显示全部楼层
void ST7529Ini(void)   
{   
    LCD_CmdWrite(0X30);   //EXT=0      
    LCD_CmdWrite(0X94);   //SLEEP OUT      
    LCD_CmdWrite(0XD1);   //OSC ON      
  
    LCD_CmdWrite(0x20);   //POWER CONTROL SET      
    LCD_DataWrite(0X0B);   //BOOSTER ON      
     
    LCD_CmdWrite (0x81);   //ELECTRONIC CONTROL      
    LCD_DataWrite(0X20);   //DL    30  
    LCD_DataWrite(0X04);   //DH      
     
    LCD_CmdWrite (0xCA);   //DISPLAY CONTROL      
    LCD_DataWrite(0x00 );   //CLD=0,NOT DIVIDE      
    LCD_DataWrite(0x27);   //1/160 DUTY 39      
    LCD_DataWrite(0X00);   //FR      
     
    LCD_CmdWrite(0xA7);   //Reverse display  ~A6?   
       
    LCD_CmdWrite (0xBB);   //COM SCAN DIRECTION      
    LCD_DataWrite(0X02);   //C79->C0,C80->C159      
     
    LCD_CmdWrite (0xBC);   //Data Scan Direction      
    LCD_DataWrite(0X01);   
    LCD_DataWrite(0X00);   //CLR=0      
    LCD_DataWrite(0X02);   //32 Gray-scale 3byte 3pixel mode      
     
    LCD_CmdWrite (0x75);   //Line address set      
    LCD_DataWrite(0x00);   //Start Line      
    LCD_DataWrite(0x9f);   //End Line  (160)   
     
    LCD_CmdWrite (0x15);   //Column address set      
    LCD_DataWrite(0x00);   //Start Column      
    LCD_DataWrite(0X54);   //End Column (84)      
     
    LCD_CmdWrite (0x31);   //ext=1      
    LCD_CmdWrite (0x32);   //Analog circuit set      
    LCD_DataWrite(0X07);   //FR=12.7KHZ      
    LCD_DataWrite(0X02);   //Booster FR=6KHZ      
    LCD_DataWrite(0X03);   //1/11bias   01 调对比度  
     
    LCD_CmdWrite (0x34);   //Dithering off      
    LCD_CmdWrite (0x30);   //EXT=0      
               
    LCD_CmdWrite (0xAF);   //DISP ON      
}
这个是最终版。。的初始化函数。。
回复

使用道具 举报

发表于 2015-6-2 13:01 | 显示全部楼层
void ASIIC(unsigned char x1, unsigned char y1, unsigned char *ASIC,unsigned char type)  
{   
   unsigned char x,uc_CharCode,uc_BitCnt;  
   //unsigned long j=0;
         unsigned char X_Count,Y_Cout;
         if(type)
          {
                 X_Count = 8;
                 Y_Cout  = 16;       
                 }
         else
          {
           X_Count = 6;
                 Y_Cout  = 12;          
           }
     
   LCD_CmdWrite(0x30);      
   LCD_CmdWrite(0x75);
                 
   LCD_DataWrite(x1);  
   LCD_DataWrite(x1+Y_Cout-1);
   
         LCD_CmdWrite(0x15);                              
  
         LCD_DataWrite(0X54-(y1+(X_Count-1)/3));  
    LCD_DataWrite((0X54-y1));
   LCD_CmdWrite(0X5C);  
       
   for(x=0;x<Y_Cout;x++)  
   {                  
          uc_CharCode = *ASIC;       
          ASIC ++;               
          if(type==0) uc_CharCode = uc_CharCode>>2;                 
          for(uc_BitCnt=0;uc_BitCnt<X_Count;uc_BitCnt++)   
             {   
               if((uc_CharCode&0x01) == 0) { LCD_DataWrite(0x00);}     
               else                        { LCD_DataWrite(0xFF);}      
               uc_CharCode =uc_CharCode >>1;
              }                    
        if(type) LCD_DataWrite(0x00);  
   }   
}
void HanZi(unsigned char x1, unsigned char y1 ,unsigned char*hanzi,unsigned char type)  
{   
         unsigned int Dat;
   unsigned char x,uc_BitCnt;  
         //unsigned char CoderDat[32];
   //unsigned long j=0;       
          unsigned char X_Count,Y_Cout;
         if(type)
          {
                 X_Count = 16;
                 Y_Cout  = 16;       
                 }
         else
          {
           X_Count = 12;
                 Y_Cout  = 12;          
           }
         
   LCD_CmdWrite(0x30);    //EXT=0  

   LCD_CmdWrite(0x75);                           
   LCD_DataWrite(x1);  
   LCD_DataWrite((x1+Y_Cout-1));  
     
   LCD_CmdWrite(0x15);                              
         LCD_DataWrite(0X54-(y1+(X_Count-1)/3));
   LCD_DataWrite((0X54-y1));
                 
   LCD_CmdWrite(0X5C);  
         
//         j=(((hanzi-0xB0A1)*32)/528 + 4)<<10;
//         j = j + (((hanzi-0xB0A1)*32)%528);
//         Continuous_Array_Read_3(CoderDat,j,32);
//   uc_CharCode        = CoderDat[x*2+1];                         
                 
   for(x=0;x<X_Count;x++)  
   {                  
                  Dat =  *hanzi;
                  hanzi++;
                  Dat = (Dat<<8) + (*hanzi);
                  hanzi++;
      if(type==0) Dat = Dat>>4;                                 
      for(uc_BitCnt=0;uc_BitCnt<Y_Cout;uc_BitCnt++)
        {   
          if((Dat&0x0001) == 0)        { LCD_DataWrite(0x00);}     
           else                        { LCD_DataWrite(0xFF);}      
           Dat =Dat >>1;
        }               
               
                if(type)
                 {
                  LCD_DataWrite(0x00);
                  LCD_DataWrite(0x00);
                  }                          
   }   
}
写英文 写汉字函数。。
回复

使用道具 举报

发表于 2015-6-2 13:10 | 显示全部楼层
20150602_130800.jpg
回复

使用道具 举报

发表于 2015-6-2 13:14 | 显示全部楼层
这个屏貌似可以显示32级灰度,谁能发个带灰度的程序谢谢!
回复

使用道具 举报

发表于 2015-6-2 13:19 | 显示全部楼层
清风 发表于 2015-6-2 13:14
这个屏貌似可以显示32级灰度,谁能发个带灰度的程序谢谢!

if((uc_CharCode&0x01) == 0) { LCD_DataWrite(0x00);}     
               else                        { LCD_DataWrite(0xFF);}


里边的数字改成灰度值就可以了。
回复

使用道具 举报

发表于 2015-6-2 13:37 | 显示全部楼层
好,谢谢了!
回复

使用道具 举报

发表于 2015-6-2 13:42 来自手机 | 显示全部楼层
还有优惠吗? 我也撸个10片
回复

使用道具 举报

发表于 2015-6-2 14:06 | 显示全部楼层
买过楼主东西,非常的质优价廉,适合坛友们,话说高手真是迅雷不及掩耳之势啊!!
回复

使用道具 举报

发表于 2015-6-2 14:52 | 显示全部楼层
效果不错,可惜错过时间了!
回复

使用道具 举报

本版积分规则

QQ|一淘宝店|手机版|商店|一乐电子 ( 粤ICP备09076165号 ) 公安备案粤公网安备 44522102000183号

GMT+8, 2025-8-21 23:43 , Processed in 0.038847 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表