BlackOneデモプログラム SDカード上のイメージと漢字メッセージをスライドショー表示します 表示するイメージは、予めマイクロSDカードに入れて、LCD上部についているマイクロSDカードソケットにセットしておく必要があります

Dependencies:   mbed

Committer:
techand
Date:
Fri Dec 23 05:15:27 2011 +0000
Revision:
0:55142cea6326

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
techand 0:55142cea6326 1 #include "mbed.h"
techand 0:55142cea6326 2 Serial pc(USBTX, USBRX); // tx, rx
techand 0:55142cea6326 3 Serial e_Disp2(p9, p10); // tx, rx
techand 0:55142cea6326 4
techand 0:55142cea6326 5 // Kanji Messages
techand 0:55142cea6326 6 char msg2[] = {0x8a,0xbf,0x8e,0x9a,0x83,0x74,0x83,0x48,0x83,0x93,0x83,0x67,0x93,0xe0,0x91,0xa0,0x54,0x46,0x54,0x83,0x4a,0x83,0x89,0x81,0x5b,0x4c,0x43,0x44,0x82,0xc6};
techand 0:55142cea6326 7 char msg3[] = {0x58,0x62,0x65,0x65,0x96,0xb3,0x90,0xfc,0x83,0x82,0x83,0x57,0x83,0x85,0x81,0x5b,0x83,0x8b,0x82,0xcc,0x83,0x5c,0x83,0x50,0x83,0x62,0x83,0x67,0x82,0xf0,0x91,0x95,0xf5};
techand 0:55142cea6326 8 char msg4[] = {0x6d,0x62,0x65,0x64,0x81,0x69,0x4c,0x43,0x50,0x31,0x37,0x36,0x38,0x81,0x6a,0x82,0xcc,0x8a,0x88,0x97,0x70,0x82,0xcc,0x95,0x9d,0x82,0xf0,0x8d,0x4c,0x82,0xb0,0x82,0xe9};
techand 0:55142cea6326 9 char msg5[] = {0x4c,0x43,0x50,0x58,0x70,0x72,0x65,0x73,0x73,0x6f,0x81,0x40,0x4c,0x43,0x50,0x31,0x37,0x36,0x39,0x82,0xe0,0x4f,0x21};
techand 0:55142cea6326 10
techand 0:55142cea6326 11
techand 0:55142cea6326 12 // Display Kanji Message
techand 0:55142cea6326 13 void msg()
techand 0:55142cea6326 14 {
techand 0:55142cea6326 15 e_Disp2.printf("\x1b@0Z"); // clear all
techand 0:55142cea6326 16 e_Disp2.printf("\x1b@0;0;320;240;0;0;32767z"); // Fill White BG-Buff
techand 0:55142cea6326 17
techand 0:55142cea6326 18 e_Disp2.printf("\x1b[1;30;m"); // Set Color of Char to BLACK
techand 0:55142cea6326 19 e_Disp2.printf("%s\n\r",msg2);
techand 0:55142cea6326 20 e_Disp2.printf("\x1b[1;31;m"); // Set Color of Char to RED
techand 0:55142cea6326 21 e_Disp2.printf("%s\n\r",msg3);
techand 0:55142cea6326 22 e_Disp2.printf("\x1b[1;32;m"); // Set Color of Char to GREEN
techand 0:55142cea6326 23 e_Disp2.printf("%s\n\r",msg4);
techand 0:55142cea6326 24 e_Disp2.printf("\x1b[1;34;m"); // Set Color of Char to BLUE
techand 0:55142cea6326 25 e_Disp2.printf("%s\n\r",msg5);
techand 0:55142cea6326 26
techand 0:55142cea6326 27 }
techand 0:55142cea6326 28
techand 0:55142cea6326 29
techand 0:55142cea6326 30
techand 0:55142cea6326 31 int main() {
techand 0:55142cea6326 32 e_Disp2.printf("\x1b[2J"); // Clear all charactors and set curser to Homeposition
techand 0:55142cea6326 33
techand 0:55142cea6326 34 e_Disp2.printf("\x1b@30Z"); // Set Buffer_0 to BackGround buffer
techand 0:55142cea6326 35 e_Disp2.printf("\x1b@80Z"); // BackLight ON
techand 0:55142cea6326 36 for (;;)
techand 0:55142cea6326 37 {
techand 0:55142cea6326 38 for (int i=1 ;i<=9;i++)
techand 0:55142cea6326 39 { // Display Image
techand 0:55142cea6326 40 e_Disp2.printf("\x1b@%d;0I",i);
techand 0:55142cea6326 41 wait_ms(2000);
techand 0:55142cea6326 42 }
techand 0:55142cea6326 43 msg(); // Display KANJI msg
techand 0:55142cea6326 44 wait_ms(5000);
techand 0:55142cea6326 45 e_Disp2.printf("\x1b[2J");
techand 0:55142cea6326 46 }
techand 0:55142cea6326 47 }