main.c
来自「包内含有关于ipod mp3透反式1.46 tft液晶屏的avr示例程序和液晶屏」· C语言 代码 · 共 40 行
C
40 行
#include <avr/io.h>
#include <avr/delay.h>
#include <math.h>
#include "H146IT01.h"
void PortInit(void)
{
DDRA = 0xff;
DDRC = 0xff;
DDRD = 0xff;
}
int main(void)
{
double x,y;
PortInit();
LCDInit();
DisplayScreen(0xff, 0x00, 0x00);
for(x=0; x<120; x+=0.1)
{
y = sin(x/10)*30;
PutPixel(x, (int)(y+80), 0x00, 0xff, 0x0f);
PutPixel(x+10, (int)(y+80), 0xf0, 0x3f, 0xf3);
}
PutString(0, 0, "I'm what I am, I'm ldqmoon!", 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x23);
PutString(0,110, "www. acgclub.com", 0x26, 0x0f, 0x82, 0xac, 0x43, 0x65);
while(1);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?