TA的每日心情 | 开心 2015-3-18 14:53 |
|---|
签到天数: 1 天 连续签到: 1 天 [LV.1]初来乍到
秀才
- 积分
- 267
|
本帖最后由 hejunpeng 于 2015-10-22 18:08 编辑
Atmel SAM L22 OLED快速上手指南 ——基于Atmel Studio 和Atmel软件框架(ASF)
本贴实现功能的是通过Atmel ASF软件库的 GFX图形库对OLED(SSD1306)屏幕进行显示操作,包括写字符串和画线。
①关于Atmel Studio 的使用说明,工程建立,ASF软件库添加,请参考:
https://www.cirmall.com/bbs/thread-44305-1-1.html
②添加以下两个ASF库
GFX Monochrome - Monochrome Graphic Library (service)
GFX Monochrome - System Font (service)
③编写代码,屏幕画方框,中间显示爱板网址,示例代码如下:
- #include <asf.h>
- int main (void)
- {
- system_init();
- gfx_mono_init();
- while (1)
- {
- gfx_mono_draw_string("www.eeboard.com", 20, 11, &sysfont);
- gfx_mono_draw_line(0, 0, 127, 0, 1);
- gfx_mono_draw_line(127, 0, 127, 31, 1);
- gfx_mono_draw_line(127, 31, 0, 31, 1);
- gfx_mono_draw_line(0, 31, 0, 0, 1);
- gfx_mono_draw_line(2, 2, 125, 2, 1);
- gfx_mono_draw_line(125, 2, 125, 29, 1);
- gfx_mono_draw_line(125, 29, 2, 29, 1);
- gfx_mono_draw_line(2, 29, 2, 2, 1);
- }
- }
复制代码
③下载验证,显示效果如下:
|
|