📄 main._c
字号:
/************************************************
文件:main.c
用途:3310_5510LCD驱动演示文件
注意:
创建:2008.1.25
修改:2008.1.25
Copy Right (c) www.avrvi.com AVR与虚拟仪器
************************************************/
#include "config.h"
#include "lib\bmp_pixel.h"
#include "lib\write_chinese_string_pixel.h"
#include "lib\move_chinese_string_pixel.h"
/******************************************************************************/
void main(void)
{
OSCCAL=0x9d; // 8M系统内部时钟校准
//设置MCU的I/O口(SPI)
DDRB |= LCD_RST | LCD_DC | LCD_CE | SPI_MOSI | SPI_CLK;
SPSR |= BIT(SPI2X); // 设置SPI时钟倍速
SPCR |= BIT(SPE)|BIT(MSTR); // 使能SPI接口,主机模式,4M时钟
LCD_init(); //初始化液晶
LCD_draw_bmp_pixel(18,1,AVR_bmp,48,24); //显示AVR大图
delay_nms(1500);
LCD_clear();
while(1)
{
LCD_write_english_string(0,3,"AVR");
LCD_write_chinese_string(24,3,12,5,0,0,write_chinese_string); //显示“与虚拟仪器”,在x=24,y=3位置,显示write_chinese_string的12点阵汉字,显示5个,从第0个开始显示,行距为0,
LCD_write_english_string(0,5,"www.avrvi.com");
LCD_move_chinese_string(0,1,200,move_chinese_string);
LCD_move_chinese_string(0,0,200,move_chinese_string); //在屏幕最上面一行显示:欢迎光临本网站!显示速度为200,数值越大,速度越慢。
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -