xtest18_8k.c
来自「AT91sam7s 256 B/D example」· C语言 代码 · 共 36 行
C
36 行
/* ========================================================================== */
/* 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 + =
减小字号Ctrl + -
显示快捷键?