图片生成.c

来自「EEPROM读写程序: 先向EEPROM写入一幅图片数据」· C语言 代码 · 共 40 行

C
40
字号
//读取EEPROM中的数据,并在128*64显示屏上显示。
#include <iom16v.h>
#include <macros.h> 
char r_y[];//读取数取缓存
void LCMDisplayPicture(int n)//显示一幅图片
{
 	 char *r;
	 int b;
	 int c;
	 char CurrentCol=0x80;
	 char CurrentRow=0x80;
	 char i,j;
	 r=r_y;
	 LCMWriteCommand(0x34); 
	 for  (i=0;i<64;i++) 
	 {
	  	CurrentRow=0x80+i; 
		if(CurrentRow>0x9F) 
		CurrentRow=0x80+CurrentRow-0xa0; 
		twi_init();
		rd24c(r,i*16+n,16);
		r=r_y;
		for  (j=0;j<8;j++) 
		{
		 	 if (i<=31) 
			 CurrentCol=0x80; 
			 if (i>31) 
			 CurrentCol=0x88; 
			 CurrentCol=CurrentCol+j;
			 LCMWriteCommand(CurrentRow);
			 LCMWriteCommand(CurrentCol);

			 LCMWriteData(r_y[2*j]);     //低八位
			 LCMWriteData(r_y[2*j+1]);   //高八位
		} 	
		LCMWriteCommand(0x36); //扩充指令集 绘图开
	} 
    LCMWriteCommand(0x30); //基本指令集 绘图关      
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?