SHARPメモリ液晶+つぼフォント(GT20L16J1Y) の表示サンプル。 半角カナ(JIS X 0201)と、2バイトUTF-8コード(顔文字に使用)に対応。

Dependencies:   GT20L16J1Y_font TFT_fonts mbed sharp_mlcd

Fork of hello_GT20L16J1Y_FONT by Toyomasa Watarai

main.cpp

Committer:
MACRUM
Date:
2014-01-14
Revision:
0:b468ef973095
Child:
3:b095be7ec287

File content as of revision 0:b468ef973095:

#include "mbed.h"
#include "C12832_lcd.h"
#include "GT20L16J1Y_font.h"

/* 
    GT20L16J1Y library test program
    works with mbed application board
*/

C12832_LCD lcd;
GT20L16J1Y_FONT font(p11, p12, p13, p10);

void draw_kanji(int offset_x, int offset_y)
{
    int color;
    for(int x=0; x<32; x++)
    {
        for(int y=0; y<8; y++)
        {
            if (font.bitmap[x] & (1<<y))
                color = 1;
            else
                color = 0;
            lcd.pixel(x%16 + offset_x, y+(8*(x>>4)) + offset_y, color);
        }
    }
    lcd.copy_to_lcd();
}

int main()
{
    unsigned short kbuf[16] = {
        0x9069,
        0x92BB,
        0x82C7,
        0x82A4,
        0x82C5,
        0x82B7,
        0x82A9,
        0x8148
    };
        
    lcd.cls();

    for(int i=0; i<8; i++) {
        font.read(kbuf[i]); 
        draw_kanji(16*i, 0);
    }
    
}