oled屏上显示一个圆
假设想让oled屏上显示一个圆,所对应的程序是自己写,还是有专门的软件生成{:4_165:}{:4_165:} 可以用这个程序。
/*****************************************************************************
* @name :void _draw_circle_8(int xc, int yc, int x, int y, u16 c)
* @date :2018-08-09
* @function :8 symmetry circle drawing algorithm (internal call)
* @parameters :xc:the x coordinate of the Circular center
yc:the y coordinate of the Circular center
x:the x coordinate relative to the Circular center
y:the y coordinate relative to the Circular center
c:the color value of the circle
* @retvalue :None
******************************************************************************/
void _draw_circle_8(int xc, int yc, int x, int y, u16 c)
{
GUI_DrawPoint(xc + x, yc + y, c);
GUI_DrawPoint(xc - x, yc + y, c);
GUI_DrawPoint(xc + x, yc - y, c);
GUI_DrawPoint(xc - x, yc - y, c);
GUI_DrawPoint(xc + y, yc + x, c);
GUI_DrawPoint(xc - y, yc + x, c);
GUI_DrawPoint(xc + y, yc - x, c);
GUI_DrawPoint(xc - y, yc - x, c);
}
只需在屏上显示一个点,然后整个屏用马达带动转起来看,绝对圆,分毫不差 一般用GUI库,这些画线画圈,显示文字的函数都是封装好的,只需要输入坐标信息、颜色信息。找对应的驱动示例工程里一般就有。
可以参考例程函数,直接用也可以 遇到过这个需求,没想通,放弃了。后来没事又想,寻思放个图片是不是也可以:-) 感谢各位
页:
[1]