Skip to content

Instantly share code, notes, and snippets.

@ksasao
Last active August 29, 2015 14:04
Show Gist options
  • Save ksasao/9a078c7cd950b11bb21e to your computer and use it in GitHub Desktop.
Save ksasao/9a078c7cd950b11bb21e to your computer and use it in GitHub Desktop.
MicroView で画像を表示するためのサンプルコードです。画像データの形式は https://github.com/geekammo/MicroView-Arduino-Library/blob/master/MicroView.cpp 等を参照してください。ライセンスは WTFPL です。
#include <MicroView.h>
static uint8_t buffer [384] = {3,140,33,148,0,218,34,148,106,18,128,42,192,202,22,160,22,104,22,160,216,2,160,22,108,128,30,224,22,72,178,4,234,20,138,0,126,0,14,160,222,24,82,206,40,34,84,150,0,168,0,134,56,198,40,66,158,32,24,226,2,0,106,244,0,0,254,128,0,127,128,42,245,0,96,60,163,158,216,64,93,91,80,215,29,184,226,1,156,98,168,69,218,37,218,37,194,60,64,60,195,216,46,11,175,47,46,105,11,212,157,176,98,48,24,205,70,168,2,73,144,34,0,90,163,20,64,30,0,128,30,229,24,193,22,104,253,8,224,251,253,126,255,4,127,253,163,255,0,239,255,254,253,254,253,243,238,221,191,109,127,243,220,255,223,255,196,4,255,241,235,127,0,254,254,252,251,0,136,119,136,83,172,0,1,64,191,0,131,236,129,16,0,74,48,67,28,226,10,168,99,140,63,239,255,119,255,223,254,236,253,254,190,255,239,255,255,254,239,127,251,127,127,127,127,254,125,127,223,253,255,239,254,222,254,246,127,239,253,255,135,240,63,12,227,26,128,2,16,100,3,12,0,255,247,127,0,37,144,165,136,80,39,24,42,71,184,193,3,15,31,63,62,111,255,255,223,253,247,255,193,178,248,126,238,190,251,238,254,182,254,60,193,255,255,254,223,127,126,63,31,15,199,50,194,168,50,12,71,0,90,128,1,169,33,144,72,17,37,128,0,88,64,24,96,0,17,97,8,64,33,18,5,88,16,34,80,32,4,64,1,3,163,7,247,39,239,43,239,47,222,47,238,15,119,39,251,3,17,0,168,0,10,96,88,22,41,12,3,80,36,17,10,33,18,68,132,25,66,0,160,254,223,247};
void setup()
{
uView.begin();
uView.clear(PAGE);
drawImage(buffer);
}
void loop()
{
}
void drawImage(uint8_t *data){
int p = 0;
for (int i=0; i<6; i++) {
uView.setPageAddress(i);
uView.setColumnAddress(0);
for (int j=0;j<0x40;j++) {
uView.data(data[p]);
p++;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment