智能车制作

 找回密码
 注册

扫一扫,访问微社区

12
返回列表 发新帖
楼主: 401
打印 上一主题 下一主题

如何用C语言在12864液晶上显示图画?

  [复制链接]

1

主题

4

帖子

0

精华

高级会员

Rank: 4

积分
523
QQ
威望
453
贡献
70
兑换币
2
注册时间
2010-5-24
在线时间
0 小时
11#
发表于 2010-5-24 20:18:12 | 只看该作者
其实这种东西我们也确实的需要!
回复 支持 反对

使用道具 举报

0

主题

0

帖子

0

精华

注册会员

Rank: 2

积分
123
威望
171
贡献
22
兑换币
0
注册时间
2010-5-2
在线时间
0 小时
12#
发表于 2010-7-19 05:06:09
顶了再看看




--------------------------------------------------------------------------------------------------------------------
传奇私服传奇私服传奇私服传奇私服传奇私服传奇私服传奇私服传奇私服
支持 反对

1

主题

5

帖子

0

精华

金牌会员

Rank: 6Rank: 6

积分
1444
威望
211
贡献
1229
兑换币
10
注册时间
2010-9-3
在线时间
2 小时
13#
发表于 2010-9-19 00:45:21 | 只看该作者
我这边有一款彩色的开发资料 可以分享下

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复 支持 反对

使用道具 举报

1

主题

37

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
319
威望
263
贡献
54
兑换币
0
注册时间
2010-10-17
在线时间
1 小时
14#
发表于 2010-10-18 00:03:58 | 只看该作者
#include<reg52.h>
#define uchar unsigned char
#define uint unsigned int
sbit rs=P3^0;
sbit rw=P3^1;
sbit e=P3^2;
uchar  busy;
void delay(uchar z)
{
  uchar x,y;
  for(x=z; x>0;x--)
    for(y=110;y>0;y--);
}
void delay100(uint n)
{
        uchar i;
        while(n--)
        for(i=0;i<40;i++);
}
void  check_busy(void)
{
  rs = 0;
  rw = 1;  //读命令
do  {
   
    e = 1;
    busy = P0;    //busy=P0这条语句一定要在  "e=1 "的后面   谨记  
    delay(5);
        e = 0;
        }while(busy&0x80);
}

void write_com(uchar com)
{  
  check_busy();
  rs=0;
  rw=0;

  e=1;
   P0=com;
  delay(5);
  e=0;
  delay(5);
}

void write_dat(uchar dat)
{  
  check_busy();
  rs=1;
  rw=0;
  
  e=1;
  P0=dat;
  delay(5);
  e=0;
  delay(5);
}
uchar code pic[]={
/*--  宽度x高度=128x64  --*/
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x1F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x01,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x07,0xFC,0x7F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x1F,0x00,0x03,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x7C,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0xF0,0x00,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x80,0x01,0xC0,0x00,0x00,0x07,0x00,0x0E,0x1C,0x00,0x00,0x07,0x00,0x00,0x00,0x01,
0x80,0x03,0x80,0x00,0x00,0x03,0x90,0x0E,0x1C,0x00,0x10,0x3F,0x80,0x00,0x00,0x01,
0x80,0x07,0x40,0x00,0x00,0x01,0xC0,0x0C,0x1C,0x00,0x3F,0xFF,0x80,0x00,0x60,0x01,
0x80,0x0E,0x00,0x00,0x00,0x00,0xE0,0x0C,0x1C,0x60,0x3E,0x40,0x07,0xFF,0xE0,0xF1,
0x80,0x1C,0x00,0x00,0x00,0x00,0x70,0x0D,0xFF,0xE0,0x38,0x70,0x03,0xFF,0xE3,0xF1,
0x80,0x3A,0x00,0x00,0x00,0x00,0x38,0x3F,0x9C,0xE0,0x38,0x70,0x03,0x80,0x63,0xF1,
0x80,0x30,0x00,0x00,0x00,0x00,0x18,0x3F,0x9C,0xE0,0x30,0x60,0x03,0x80,0x03,0xF1,
0x80,0x70,0x00,0x00,0x00,0x00,0x1C,0x3F,0x9C,0xE0,0x30,0x60,0xC3,0x9E,0x03,0x71,
0x80,0xE0,0x00,0x00,0x00,0x00,0x0C,0x7D,0x9C,0xE0,0x70,0x61,0xE3,0xFF,0xC0,0x71,
0x80,0xC0,0x00,0x00,0x00,0x00,0x0E,0x7C,0x1C,0xF8,0x7F,0xFF,0xE7,0xFF,0xE0,0x71,
0x80,0xC0,0x0F,0x00,0x00,0xC0,0x06,0x6F,0xFF,0xF8,0x30,0x60,0x03,0xE1,0xE0,0x71,
0x81,0x80,0x1F,0x80,0x01,0xE0,0x07,0x0F,0xFF,0xF8,0x0E,0x6C,0x01,0xC0,0xF0,0x71,
0x81,0x80,0x1F,0x80,0x03,0xF0,0x03,0x0C,0x1E,0x00,0x0F,0x6F,0x00,0x00,0x70,0x71,
0x83,0x80,0x1F,0x80,0x03,0xF0,0x03,0x0C,0x3F,0x00,0x1E,0x67,0x81,0x00,0x70,0x71,
0x83,0x80,0x1F,0x80,0x03,0xF0,0x03,0x8C,0x3B,0x00,0x3C,0x63,0xC3,0x80,0xE0,0x71,
0x83,0x00,0x1F,0x80,0x03,0xF0,0x01,0x8C,0x73,0x80,0x78,0x61,0xC7,0xC1,0xE0,0x71,
0x83,0x00,0x1F,0x80,0x03,0xF0,0x01,0x8C,0xF1,0xC0,0xE0,0x61,0xC7,0xFF,0xC0,0x71,
0x83,0x00,0x1F,0x80,0x03,0xF0,0x01,0x8C,0xE1,0xF1,0xC3,0xE0,0xC0,0xFF,0x80,0xF1,
0x87,0x00,0x0F,0x00,0x01,0xE0,0x01,0x8F,0xC0,0xF9,0x83,0xE0,0x00,0x3E,0x00,0x01,
0x87,0x00,0x06,0x00,0x00,0xD0,0x01,0xCF,0x80,0x70,0x00,0xE0,0x00,0x00,0x00,0x01,
0x87,0x00,0x00,0x00,0x00,0x00,0x01,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x87,0x00,0x00,0x00,0x00,0x00,0x01,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x87,0x00,0x00,0x00,0x00,0x00,0x01,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x87,0x00,0x00,0x00,0x00,0x00,0x01,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x87,0x00,0x00,0x00,0x00,0x00,0x01,0xBF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF1,
0x83,0x00,0x00,0x00,0x00,0x00,0x01,0xBF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF1,
0x83,0x00,0x00,0x00,0x00,0x00,0x01,0xBF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF1,
0x83,0x00,0x00,0x00,0x00,0x00,0x01,0xBF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF1,
0x83,0x00,0x00,0x00,0x00,0x20,0x03,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x83,0x80,0x18,0x00,0x00,0x60,0x03,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x81,0x80,0x1C,0x00,0x00,0xF0,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x81,0x80,0x1E,0x00,0x01,0xE0,0x07,0x03,0xFC,0x03,0xFC,0x03,0xFC,0x07,0xF8,0x01,
0x81,0xC0,0x1F,0x00,0x03,0xE0,0x06,0x07,0xFF,0x07,0xFE,0x07,0xFE,0x0F,0xFE,0x01,
0x80,0xC0,0x0F,0x80,0x07,0xE0,0x0E,0x1F,0x8F,0x0F,0x9F,0x0F,0x9F,0x1F,0x1E,0x01,
0x80,0xE0,0x0F,0xC0,0x07,0xE0,0x0E,0x1E,0x07,0x1E,0x07,0x9E,0x07,0x9C,0x0F,0x01,
0x80,0x60,0x07,0xE0,0x0F,0xC0,0x1C,0x0E,0x03,0x1C,0x03,0x9C,0x03,0x9C,0x07,0x01,
0x80,0x70,0x03,0xF0,0x3F,0x80,0x18,0x00,0x07,0x1C,0x03,0x9C,0x03,0x9C,0x07,0x81,
0x80,0x38,0x01,0xFC,0xFF,0x00,0x38,0x00,0x0F,0x38,0x03,0xB8,0x03,0x9C,0x0F,0x81,
0x80,0x18,0x00,0xFF,0xFE,0x00,0x70,0x00,0x3E,0x38,0x01,0xB8,0x01,0x9F,0x1F,0x81,
0x80,0x0C,0x00,0x3F,0xF8,0x00,0xE0,0x00,0xFC,0x38,0x01,0xB8,0x01,0x8F,0xFF,0x81,
0x80,0x0E,0x00,0x07,0x80,0x01,0xC0,0x03,0xF0,0x3C,0x03,0xBC,0x03,0x87,0xFB,0x01,
0x80,0x07,0x00,0x00,0x00,0x03,0xC0,0x07,0xC0,0x1C,0x03,0x9C,0x03,0x80,0x07,0x01,
0x80,0x03,0xC0,0x00,0x00,0x07,0x00,0x07,0x80,0x1E,0x07,0x9E,0x07,0x98,0x0F,0x01,
0x80,0x01,0xE0,0x00,0x00,0x1E,0x00,0x0F,0x00,0x8F,0x0F,0x0F,0x0F,0x1E,0x1E,0x01,
0x80,0x00,0x78,0x00,0x00,0x7C,0x00,0x0F,0xFF,0x8F,0xFE,0x0F,0xFE,0x3F,0xFE,0x01,
0x80,0x00,0x3E,0x00,0x01,0xF8,0x00,0x1F,0xFF,0x83,0xFC,0x03,0xFC,0x0F,0xF8,0x01,
0x80,0x00,0x0F,0xE0,0x1F,0xE0,0x00,0x18,0x01,0x80,0xF0,0x00,0xF0,0x01,0xE0,0x01,
0x80,0x00,0x03,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x7F,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF
};
void lcdcls(void)
{
        write_com(0x01);
        write_com(0x34);
        write_com(0x30);
}

void init(void)
{
            write_com(0x30) ;              //基本指令集
            delay(10) ;
            write_com(0x06) ;              //光标右移
            delay(10) ;
            write_com(0x0c);              //开显示     游标位置不显示    0x0e 则显示
            delay(10) ;
            write_com(0x01) ;             //清屏
}
void lcd_dis(void)
{   

  uchar i,j,k;//先设垂直地址再设水平地址(连续写入两个字节的资料来完成垂直与水平的坐标地址)
   uint x=0;
   uchar LCD_X=0x80;
for(k=0;k<2;k++)
{
    for(i=0;i<32;i++)                          //写垂直(Y轴)数据                                                           
                {
                 write_com(0x80+i);
             write_com(LCD_X);
         
                        for(j=0;j<16;j++)                       //写水平(X轴)数据
                        {
                                write_dat(pic[x]);  
                                x++;
                        }          
                }
        LCD_X=0x88;
  }
}               

void main(void)
{   
    init();
          delay100(10);
while(1)
{
        write_com(0x36);                     //设置显示图形方式
                lcd_dis();                               //图形方式下显示(我的电脑和我的文档)
                delay100(5000);
                lcdcls();                               //清除当前显示

                delay100(100);

}   

}

你可以参考一下我的程序           还不懂的话  可以联系我  Q262439672
回复 支持 反对

使用道具 举报

0

主题

185

帖子

0

精华

高级会员

Rank: 4

积分
791
QQ
威望
534
贡献
129
兑换币
72
注册时间
2009-4-4
在线时间
64 小时
15#
发表于 2011-3-22 20:23:24 | 只看该作者
看看了
回复 支持 反对

使用道具 举报

0

主题

42

帖子

0

精华

高级会员

Rank: 4

积分
561
威望
342
贡献
131
兑换币
3
注册时间
2012-2-12
在线时间
44 小时
毕业学校
西南科技大学
16#
发表于 2012-2-20 20:51:18 | 只看该作者
学习~~~
回复 支持 反对

使用道具 举报

1

主题

111

帖子

0

精华

高级会员

Rank: 4

积分
606
威望
419
贡献
105
兑换币
0
注册时间
2012-2-16
在线时间
41 小时
17#
发表于 2012-4-27 22:59:31 | 只看该作者
图画我做过!挺好玩的!不过你要有那个取模的软件!还有就是你的区和行数据要弄好!否则会是很乱的!
回复 支持 反对

使用道具 举报

0

主题

1

帖子

0

精华

注册会员

Rank: 2

积分
26
威望
94
贡献
22
兑换币
0
注册时间
2012-6-13
在线时间
0 小时
毕业学校
岭头小学
18#
发表于 2012-6-13 21:34:37 | 只看该作者
感谢12#和13#的朋友,学习了。
回复 支持 反对

使用道具 举报

1

主题

81

帖子

0

精华

高级会员

Rank: 4

积分
828
威望
439
贡献
183
兑换币
108
注册时间
2012-9-14
在线时间
103 小时
19#
发表于 2012-11-25 17:28:54 | 只看该作者
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关于我们|联系我们|小黑屋|智能车制作 ( 黑ICP备2022002344号

GMT+8, 2024-12-26 11:20 , Processed in 0.051095 second(s), 31 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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