这里根据ROTATE
的值选择顺时针还是逆时针旋转。
void OLED_DrawPoint(u8 x, u8 y, u8 t)
{
u8 i, m, n;
uint8_t x0 = x, y0 = y;
if(ROTATE == 90)
{
x = 95 - y0;
y = x0;
}
else if(ROTATE == 270)
{
x = y0;
y = 95 - x0;
}
i = y / 8;
m = y % 8;
n = 1 << m;
if(t)
{
OLED_GRAM[x][i] |= n;
}
else
{
OLED_GRAM[x][i] = ~OLED_GRAM[x][i];
OLED_GRAM[x][i] |= n;
OLED_GRAM[x][i] = ~OLED_GRAM[x][i];
}
}
网友评论