生产实训日报(17)

姓名:曹佳鑫   日期:7 月 6号

今日学习任务:ARM芯片的学习,显示屏,照片、汉字的显示。

今日任务完成情况:100%。

今日开发中遇到的问题汇总:按键按一下照片翻一张

今日未解决的问题:无。

今日开发收获:理解ARM芯片如何去使用,具体代码还有待学习

自我评价:一般

#include "main.h"
#include "led.h"
#include "key.h"
extern const unsigned char gImage_1[391680];//图片显示
extern const unsigned char gImage_2[391680];
extern const unsigned char gImage_1008[391680];
extern const unsigned char gImage_cjx[391680];   
extern const unsigned char hanzi[][32];

void delay(volatile int count)//延迟函数
{
while (count--);
}

void Main(void)
{
int key;
int i=0;
int j=0;
int p=0;
int q=0;
LCD_displaypicture(0,0,480,272,gImage_cjx);
LCD_clear(0x000000);
LCD_displaypicture(0,0,480,272,gImage_cjx);

KEY_INIT();//按键初始化

while(1)
{
key =KEY_Scan(0);//取键值
if(i>3)
{
i=0;
}


if(i<0)
{
i=4;
}


if(key==1)
{
i++;//
j=0;
q=0;
}
if(key==2)
{
i--;//
j=0;
q=0;
}

if(key==3)
{
     j=1;
q=0;
}


if(j)
{
i++;//
delay(2000000);
}

if(key==4)//
{
j=0;
i=0;
      q=1;
LCD_clear(0xffffff);
 
}
if(q)
{
     if(p<480)  
     {
   p++;
   delay(100);
    LCD_Display_16x16(p-32,136, 0x000000, hanzi[0]);
            LCD_Display_16x16(p-16,136, 0x000000, hanzi[1]);
            LCD_Display_16x16(p,136, 0x000000, hanzi[2]);
            LCD_clear(0xffffff);
     
}
}
  if(p>=480)
  {
    p=0;


  }

switch(i)
{
case 1:LCD_displaypicture(0,0,480,272,gImage_1);break;
case 2:LCD_displaypicture(0,0,480,272,gImage_2);break;
                case 3:LCD_displaypicture(0,0,480,272,gImage_1008);break;
  }
 

}  

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值