⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xtest18_8k.c

📁 AT91sam7s 256 B/D example
💻 C
字号:
/* ========================================================================== */
/*	  Xtest18_8.c : User-defined printf() Function for Graphic LCD	      */
/* ========================================================================== */
/*			  Designed and programmed by Duck-Yong Yoon in 2007.  */

#include <stdio.h>
#include "AT91SAM7S256.h"
#include "lib_AT91SAM7S256.h"
#include "OK7S256ads.h"
#include "OK7S256Korean.h"

int fputc(int ch, FILE *f)			// for the user-defined printf()
{
  if((ch >= 0x20) && (ch <= 0x7E))		// check from 0x20 to 0x7E
    GLCD_English(0,ch);

  return ch;
}

int main(void)
{ unsigned int i;
  double x;

  MCU_initialize();				// initialize AT91SAM7S256 & kit
  Delay_ms(50);					// wait for system stabilization
  LCD_initialize();				// initialize text LCD
  GLCD_clear();		               		// initialize GLCD screen
  Beep();

  LCD_string(0x80,"    printf()    ");		// display title on text LCD
  LCD_string(0xC0,"    for GLCD    ");

  GLCD_string(0,0,1," printf() 衠畞  ");	// display title on graphic LCD
  GLCD_string(1,0,0,"                ");
  GLCD_string(2,0,0,"  各畞 =   000  ");
  GLCD_string(3,0,0,"  

⌨️ 快捷键说明

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