#include "stdio.h"
#include "string.h"
#include "stdarg.h"
#define CMD_BUFFER_LEN 200
void lcdprintf (u16 x,u16 y,char *fmt, ...)
{
char buffer[CMD_BUFFER_LEN+1]; // CMD_BUFFER_LEN自己定义
u8 i = 0;
va_list arg_ptr;
va_start(arg_ptr, fmt);
vsnprintf(buffer, CMD_BUFFER_LEN+1, fmt,arg_ptr);
while ((i < CMD_BUFFER_LEN) && buffer[i])
{
LCD_ShowChar(x+=8,y,buffer[i++],16,0);
}
va_end(arg_ptr);
}
|