#include "system.h"
#include "SysTick.h"
#include "led.h"
#include "usart.h"
#include "oled.h"
int main()
{
u8 i=0;
u8 t=0;
u8 j=0;
u8 l=0;
SysTick_Init(72);
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2); //ÖжÏÓÅÏȼ¶·Ö×é·Ö2×é
USART1_Init(115200);
LED_Init();
OLED_Init();
//进度条
OLED_Clear();
for(j=10;j<110;j++)
{
OLED_Fill_rectangle(j,30,4,2,1);
OLED_Refresh_Gram();
delay_us(200);
j=j+3;
}
OLED_Clear();
OLED_ShowString(0,0,"Hello World",12);
OLED_ShowString(0,15,"Hello World",16);
OLED_Refresh_Gram();
OLED_Clear();
for(t=10;t<110;t++)
{
OLED_DrawLine(0,0,t,60,1);
OLED_Refresh_Gram();
delay_us(200);
t=t+3;
}
OLED_Clear();
for(t=64;t>4;t--)
{
OLED_DrawRectangle(64-t,32-t/2,64+t,32+t/2,1);
OLED_Refresh_Gram();
delay_us(200);
t=t-3;
}
OLED_Clear();
OLED_Fill_circle(30,30,10,1);
OLED_Fill_circle(60,30,10,1);
OLED_Fill_circle(90,30,10,1);
OLED_Refresh_Gram();
delay_ms(5);
OLED_Clear();
OLED_ShowNum(30,15,5,1,12);
OLED_Refresh_Gram();
delay_us(200);
OLED_Clear();
OLED_Fill_circle(30,30,20,1);
OLED_Fill_circle(30,30,19,0);
OLED_Fill_circle(60,30,20,1);
OLED_Fill_circle(60,30,19,0);
OLED_Fill_circle(90,30,20,1);
OLED_Fill_circle(90,30,19,0);
OLED_Refresh_Gram();
delay_ms(500);
OLED_Clear();
for(l=10;l<110;l++)
{
OLED_DrawLine(126,0,l,60,1);
OLED_Refresh_Gram();
delay_us(200);
l=l+3;
}
OLED_Clear();
OLED_Draw_ellipse(60,30,2,1,1);
OLED_Refresh_Gram();
delay_us(200);
while(1)
{
i++;
if(i%10==0)
LED0=!LED0;
delay_ms(10);
}
}
问题1:反方向的线绘制出错,求问
问题2:提供的OLED_Draw_Circle绘制出错,我使用了OLED_Fill_circle(30,30,20,1);
OLED_Fill_circle(30,30,19,0);解决。