当前位置:网站首页>Daily production training report (17)

Daily production training report (17)

2022-06-26 05:24:00 Super cute sandwich kids

full name : Caojiaxin   date :7 month 6 Number

Today's learning task :ARM Chip learning , display , Photo 、 Display of Chinese characters .

Today's task completion :100%.

Summary of problems encountered in today's development : Press the key to turn the picture

Today's unsolved problems : nothing .

Today's development gains : understand ARM How to use the chip , The specific code needs to be learned

Self evaluation : commonly

#include "main.h"
#include "led.h"
#include "key.h"
extern const unsigned char gImage_1[391680];// Picture shows
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)// Delay function
{
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();// Key initialization

while(1)
{
key =KEY_Scan(0);// Take key value
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;
  }
 

}  

}

原网站

版权声明
本文为[Super cute sandwich kids]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202180507092501.html