|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区
您需要 登录 才可以下载或查看,没有账号?立即注册
×
#include "led.h"
#include "delay.h"
#include "key.h"
#include "sys.h"
#include "oled.h"
int main(void)
{ u8 t;
delay_init(); //延时函数初始化
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2); //设置NVIC中断分组2:2位抢占优先级,2位响应优先级
LED_Init(); //LED端口初始化
OLED_Init(); //初始化OLED
OLED_ShowString(0,0,"ALIENTEK",24);
OLED_ShowString(0,24, "0.96' OLED TEST",16);
OLED_ShowString(0,40,"ATOM 2015/1/14",12);
OLED_ShowString(0,52,"ASCII:",12);
OLED_ShowString(64,52,"CODE:",12);
OLED_Refresh_Gram(); //更新显示到OLED
t=' ';
while(1)
{
OLED_ShowChar(48,48,t,16,1);//显示ASCII字符
OLED_Refresh_Gram();
t++;
if(t>'~')t=' ';
OLED_ShowNum(103,48,t,3,16);//显示ASCII字符的码值
delay_ms(500);
LED0=!LED0;
}
} |
|