找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 2646|回复: 7
打印 上一主题 下一主题
收起左侧

求大神帮我看看我为什么显示实际参数太少

[复制链接]
跳转到指定楼层
楼主
ID:306312 发表于 2018-5-28 16:13 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
#include<reg52.h>

#define uint unsigned int
#define uchar unsigned char
#define DATA P2//数据输出端0~7


sbit RS=P3^5;
sbit RW=P3^6;
sbit EN=P3^4;
sbit PSB=P3^7;

void delayms(uint xms)
{
        uint i,j;
        for(i=xms;i>0;i--)
                for(j=110;j>0;j--);
}                               

/*判断液晶忙不忙,如果忙则等待*/
void Busy()
{                                                                         
        uchar busy;                                                 
        do
        {               
                EN=0;
                RS=0;
                RW=1;
                delayms(5);
                EN=0;
                busy=P1;
                delayms(5);
                EN=0;
        }while(busy&0x80);                 //判断最高位是否为1,如果为1再循环
}
/*写LCD1602命令*/
void Write_Cmd(uchar cmd)
{
        Busy();                //判断忙
        EN=1;
        RS=0;
        RW=0;
        DATA=cmd;
        delayms(5);
        EN=0;
        delayms(5);
}
/*写一个字节数据*/
void Write_Data(uchar k)
{
        Busy();
        EN=1;
        RS=1;
        RW=0;
        DATA=k;
        delayms(5);
        EN=0;
        delayms(5);
}

void init()                                  //数据初始化
{
        PSB=1;
        delayms(5);
        Write_Cmd(0x30);                 //基本指令集
        delayms(5);
        Write_Cmd(0x0c);                 //整体显示打开,游标关闭
        delayms(5);
}

void clear_Screen()
{
        Write_Cmd(0x01);                           //清屏
        delayms(5);
}

//------------------清整个GDRAM空间----------------------------
void clear_GDRAM()
{
        uchar i,j;
        Write_Cmd(0x34);           //扩充指令及动作
        Write_Cmd(0x34);           //关绘图显示功能
        for(i=0;i<32;i++)           //上半屏
        {
                Write_Cmd(0x80+i);       //垂直地址
                Write_Cmd(0x80);         //水平地址,水平地址自动加一
                for(j=0;j<16;j++)
                {
                        Write_Data(0x00);
                }
        }
                for(i=0;i<32;i++)                 //下半屏
        {
                Write_Cmd(0x88+i);       //垂直地址
                Write_Cmd(0x88);         //水平地址,水平地址自动加一
                for(j=0;j<16;j++)
                {
                        Write_Data(0x00);
                }
        }
        Write_Cmd(0x36);           //开绘图显示
        Write_Cmd(0x30);           //回到基本指令
}
void display_Image(uchar *p)            //显示图片
{
        uchar i,j;
        Write_Cmd(0x34);           //扩充指令及动作
        Write_Cmd(0x34);           //关绘图显示功能
        for(i=0;i<32;i++)           //上半屏
        {
                Write_Cmd(0x80+i);       //垂直地址
                Write_Cmd(0x80);         //水平地址,水平地址自动加一
                for(j=0;j<16;j++)
                {
                        Write_Data(*p);                 //连续写入16个字节
                        p++;
                }
        }
                        for(i=0;i<32;i++)                 //下半屏
        {
                Write_Cmd(0x88+i);       //垂直地址
                Write_Cmd(0x88);         //水平地址,水平地址自动加一
                for(j=0;j<16;j++)
                {
                        Write_Data(*p);
                        p++;
                }
        }
        Write_Cmd(0x36);           //开绘图显示
        Write_Cmd(0x30);           //回到基本指令
}

uchar code Image[]=       //点阵图
{
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x00,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x00,
      0xFF,0xFE,0xDF,0x00,0x1C,0x0E,0x1D,0xFE,0xAF,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x00,
      0xFF,0xFE,0xBF,0xF5,0xFD,0xEF,0xD0,0x21,0xB7,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x00,
      0xFF,0xFD,0x81,0x80,0x3C,0x0E,0xD7,0xBD,0xBF,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x00,
      0xFF,0xF9,0x7D,0xB5,0xBD,0xEE,0xD0,0x20,0x03,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x00,
      0xFF,0xF4,0xEF,0x80,0x3C,0x0E,0xD7,0xFD,0xBF,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x00,
      0xFF,0xFD,0xAB,0xF7,0xFF,0xFE,0x10,0x3D,0x37,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x00,
      0xFF,0xFD,0xAB,0x00,0x00,0x03,0xD2,0xB8,0xAF,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x00,
      0xFF,0xFD,0x6D,0xEE,0xFB,0x7F,0x90,0x25,0xDF,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x00,
      0xFF,0xFC,0xED,0xC5,0xF9,0x06,0x4A,0xBD,0x9B,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x00,
      0xFF,0xFD,0xEF,0xF8,0xF6,0x7F,0xDA,0xBC,0x6B,0x7B,0xEF,0xBD,0xF8,0x00,0x00,0x00,
      0xFF,0xFD,0x8F,0x07,0x2F,0x03,0x1F,0x31,0xF3,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x00,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x00,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x00,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x00,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x00,
      0xEA,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE1,0xFF,0xFD,0xFF,0xF8,0x00,0x00,0x00,
      0xF1,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,0x3F,0xDC,0xFF,0xF8,0x00,0x00,0x00,
      0xC0,0x2F,0xFF,0xFF,0xF3,0xFF,0xFF,0xFF,0xFF,0xBD,0x8C,0xFF,0xF8,0x00,0x00,0x00,
      0xF1,0xFF,0xFF,0xFF,0xC7,0xEF,0xFF,0xFC,0xFF,0xB9,0x04,0xFF,0xF8,0x00,0x00,0x00,
      0xE8,0xFF,0xFF,0xFF,0x07,0x1F,0x7F,0xFF,0x3F,0xF0,0x20,0xFF,0xF8,0x00,0x00,0x00,
      0xDB,0x7F,0xFF,0xFC,0x0C,0x1C,0x7F,0x7F,0xCF,0xEE,0x71,0xFF,0xF8,0x00,0x00,0x00,
      0xFB,0xF7,0xE3,0xF8,0x00,0x10,0xDF,0x8F,0xF3,0xFE,0x7D,0xFF,0xF8,0x00,0x00,0x00,
      0xFF,0xFB,0xC1,0xF0,0x00,0x00,0x97,0xC1,0xF8,0xFE,0xFF,0xEF,0xF8,0x00,0x00,0x00,
      0xFB,0xEB,0x98,0xE0,0x00,0x39,0x10,0xF0,0x3C,0x3F,0xFF,0xBF,0xF8,0x00,0x00,0x00,
      0xFF,0xF1,0xA4,0xE0,0x00,0x04,0x10,0x1C,0x06,0x1F,0x8F,0x97,0xF8,0x00,0x00,0x00,
      0xFF,0xD1,0x8A,0xC0,0x00,0x00,0x30,0x00,0x01,0x0F,0x07,0x8F,0xF8,0x00,0x00,0x00,
      0xFF,0xE0,0x8A,0x00,0x00,0x00,0x30,0x38,0x00,0x06,0x33,0x1B,0xF8,0x00,0x00,0x00,
      0xFF,0xA0,0x44,0x00,0x00,0x00,0x50,0x40,0x00,0x06,0x4B,0x17,0xF8,0x00,0x00,0x00,
      0xFF,0xC0,0x60,0x00,0x0F,0xC0,0x48,0x00,0x00,0x02,0xA2,0x05,0xF8,0x00,0x00,0x00,
      0xFF,0x40,0x70,0x00,0x3F,0xE0,0x88,0x00,0x00,0x00,0xA2,0x03,0xF8,0x00,0x00,0x00,
      0xFF,0x80,0xF8,0x00,0x00,0xF1,0x04,0x07,0xE0,0x00,0x44,0x01,0xF8,0x00,0x00,0x00,
      0xFE,0x81,0xE8,0x00,0x01,0xC2,0x04,0x4F,0xF8,0x00,0x0F,0x03,0xF8,0x00,0x00,0x00,
      0xFF,0x00,0x08,0x00,0x01,0x84,0x02,0x3E,0x00,0x00,0x1F,0x82,0xF8,0x00,0x00,0x00,
      0xFD,0x00,0x10,0x00,0x00,0x88,0x01,0x06,0x00,0x00,0x10,0x41,0xF8,0x00,0x00,0x00,
      0xFE,0x01,0xE0,0x01,0x13,0x08,0x00,0x87,0x00,0x00,0x10,0x01,0xB8,0x00,0x00,0x00,
      0xFF,0x06,0x20,0x00,0x88,0x10,0x00,0x43,0x00,0x00,0x10,0x01,0x18,0x00,0x00,0x00,
      0xFD,0x0A,0x10,0x01,0x44,0x10,0x00,0x22,0x00,0x00,0x18,0x01,0xB8,0x00,0x00,0x00,
      0xF8,0x11,0x10,0x00,0x80,0x10,0x00,0x21,0x91,0x00,0x14,0x01,0xF8,0x00,0x00,0x00,
      0xFC,0x10,0x88,0x70,0x00,0x10,0x00,0x10,0x22,0x03,0xE0,0x00,0xB8,0x00,0x00,0x00,
      0xFE,0x20,0x84,0x4C,0x00,0x20,0x00,0x10,0x45,0x05,0x31,0x00,0xF8,0x00,0x00,0x00,
      0xF4,0x20,0x43,0x8B,0x80,0xC0,0x00,0x10,0x02,0x08,0x88,0x80,0xB8,0x00,0x00,0x00,
      0xFC,0x20,0x40,0x08,0xFF,0x00,0x00,0x10,0x00,0x18,0x40,0x40,0x78,0x00,0x00,0x00,
      0xF6,0x20,0x40,0x08,0x80,0x00,0x00,0x08,0x00,0x68,0x40,0x00,0xD8,0x00,0x00,0x00,
      0xFC,0x20,0x40,0x08,0x80,0x00,0x00,0x06,0x03,0x90,0x20,0x20,0x68,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
void main()
{
        init();
        display_Image();
        while(1);
}




SOCUSE CODE\C\2.C(203): warning C209: '_display_Image': too few actual parameters

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 顶 踩
回复

使用道具 举报

沙发
ID:306312 发表于 2018-5-28 16:13 | 只看该作者
谢谢各位大神
回复

使用道具 举报

板凳
ID:339930 发表于 2018-5-28 17:08 | 只看该作者
同学,你main函数里面调用display_image()没写参数。
回复

使用道具 举报

地板
ID:306312 发表于 2018-6-1 10:24 | 只看该作者
ccchengjinwang 发表于 2018-5-28 17:08
同学,你main函数里面调用display_image()没写参数。

那应该在display_image()中加什么参数啊
回复

使用道具 举报

5#
ID:333761 发表于 2018-6-1 11:21 | 只看该作者
void display_Image(uchar *p)            //显示图片
你在main函数中调用这个函数,C语言学过,总知道该怎么写参数吧?
回复

使用道具 举报

6#
ID:303383 发表于 2018-6-1 12:24 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

7#
ID:306312 发表于 2018-6-6 21:48 | 只看该作者
小猫猫爱吃鱼 发表于 2018-6-1 12:24
display_Image(Image);    //改成这样试试

谢谢
回复

使用道具 举报

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

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

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