Shinji Tadenuma
/
ej_kanji_test
BlackOneサンプルプログラム ”漢字表示” 詳細はエレキジャックのページを参照ください。 BlackOne Sample Prrogram \\\"Display Kanji Char\\\"
main.cpp@0:b650d4db4e6e, 2012-02-24 (annotated)
- Committer:
- techand
- Date:
- Fri Feb 24 09:55:34 2012 +0000
- Revision:
- 0:b650d4db4e6e
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
techand | 0:b650d4db4e6e | 1 | #include "mbed.h" |
techand | 0:b650d4db4e6e | 2 | Serial pc(USBTX, USBRX); // tx, rx |
techand | 0:b650d4db4e6e | 3 | Serial lcd(p9, p10); // lcd Port |
techand | 0:b650d4db4e6e | 4 | |
techand | 0:b650d4db4e6e | 5 | char kanji[] = {0x8A,0xBF,0x8E,0x9A,0x82,0xBE,0x82,0xBC,0x00}; |
techand | 0:b650d4db4e6e | 6 | char color[] = {0x8A,0xBF,0x8E,0x9A,0x82,0xC9,0x90,0x46,0x82,0xAA,0x82,0xC2,0x82,0xAB,0x82,0xDC,0x82,0xB7,0x00}; |
techand | 0:b650d4db4e6e | 7 | |
techand | 0:b650d4db4e6e | 8 | int main() { |
techand | 0:b650d4db4e6e | 9 | |
techand | 0:b650d4db4e6e | 10 | int y = 1; |
techand | 0:b650d4db4e6e | 11 | int x = 10; |
techand | 0:b650d4db4e6e | 12 | lcd.printf ("\x1b@0Z"); // clear all data |
techand | 0:b650d4db4e6e | 13 | lcd.printf ("\x1b[%d;%dH",y,x); // set curser |
techand | 0:b650d4db4e6e | 14 | |
techand | 0:b650d4db4e6e | 15 | lcd.printf ("BlackOne\r\n"); // display char with CRLF |
techand | 0:b650d4db4e6e | 16 | |
techand | 0:b650d4db4e6e | 17 | lcd.printf (" %s\r\n",kanji); // Dispaly 2Byte code Kajni |
techand | 0:b650d4db4e6e | 18 | lcd.printf ("\x1b[1;5;17m"); // set color |
techand | 0:b650d4db4e6e | 19 | lcd.printf ("\x1b[6;10H"); // Set cursee |
techand | 0:b650d4db4e6e | 20 | lcd.printf ("%s",color); // Dispalya |
techand | 0:b650d4db4e6e | 21 | } |