加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
8.3.7-u8gDrawXBMP.ino 1.06 KB
一键复制 编辑 原始数据 按行查看 历史
奈何col 提交于 2017-07-21 16:04 . 20170721
/*
使用u8glib显示位图
图形显示器:OpenJumper MINI 12864
控制器:Arduino UNO
*/
#include "U8glib.h"
U8GLIB_MINI12864 u8g(10, 9, 8);
/*宽度x高度=96x64*/
#define width 96
#define height 64
static unsigned charbitmap[] U8G_PROGMEM = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x80,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0xF0,0x00,0x00,0xE0,0xFF,0xFF,0x1F,
0x00,0x78,0x00,0x00,0x00,0xF0,0x1F,0x00,0x7C,0x00,0x00,0xFC,0xC0,0x7F,0x00,0x00,
//为节约篇幅,此处代码省略
0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,
0xFF,0xFF,0xFF,0xFF,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFF,0xFF,0xFF,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
void draw(void) {
// graphic commands to redraw the complete screen should be placed here
u8g.drawXBMP( 0, 0, width, height, bitmap);
}
void setup(void) {
}
void loop(void)
{
u8g.firstPage();
do
{
draw();
} while( u8g.nextPage() );
// 延时一定时间,再重绘图片
delay(500);
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化