Changes between Version 17 and Version 18 of KanjiROM


Ignore:
Timestamp:
Jul 25, 2016 8:03:42 AM (8 years ago)
Author:
kishida
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • KanjiROM

    v17 v18  
    108108 ||P||Q||R||S||T||U||V||W||X||Y||Z||ッ||ャ||ュ||ョ||■||
    109109 ||#||a||b||c||d||e||f||g||h||i||j||k||l||m||n||o||
    110  ||p||q||r||s||t||u||v||w||x||y||z||゛||゜||@||!||?||
     110 ||p||q||r||s||t||u||v||w||x||y||z||゛||゜||@||! ||?||
    111111 ||゛||゜||&||/||(||)||
    112112
     
    366366  }
    367367  Serial.println();
    368 }//sendDataToSerial32
     368}//sendDataToSerial16
    369369
    370370
     
    428428
    429429
     430=== サンプルプログラムの修正(2016/07/25) ===
     431
     432全角小文字の`o`のサイズが、大文字のものと変わらないというROM内部のフォントのデザインミスがあるようです。
     433以下のコードを追加することで正しいサイズの`o`を描画できます。
     434
     435プログラム冒頭の方に以下の配列を追加してください。
     436{{{
     437
     438const unsigned char matrixdata32_o[32] =
     439{
     440B00000000,
     441B00000000,
     442B00000000,
     443B00000000,
     444B11000000,
     445B00100000,
     446B00010000,
     447B00010000,
     448B00010000,
     449B00100000,
     450B11000000,
     451B00000000,
     452B00000000,
     453B00000000,
     454B00000000,
     455B00000000,
     456B00000000,
     457B00000000,
     458B00000000,
     459B00000000,
     460B00000011,
     461B00000100,
     462B00001000,
     463B00001000,
     464B00001000,
     465B00000100,
     466B00000011,
     467B00000000,
     468B00000000,
     469B00000000,
     470B00000000,
     471B00000000,
     472};
     473}}}
     474
     475また、`void showSJIS2byte(unsigned short code)`を以下のコードに置き換えてください。
     476{{{
     477/*2byteのSJISを表示する*/
     478//showSJIS2byte(SJIS文字コード)
     479void showSJIS2byte(unsigned short code)
     480{
     481  if(code == 0x828F)
     482  {
     483    for(int i=0;i<32;i++)
     484    {
     485      matrixdata32[i] = matrixdata32_o[i];
     486    }
     487    sendDotsToSerial32();
     488  }else{
     489    /*Arduinoのシリアルで日本語はSJIS送信なのでSJIS->JISx0208変換をする*/
     490    Serial.print("SJIS, 0x"); Serial.print(code, HEX); Serial.print("\t");
     491    uint8_t c1 = ((code & 0xff00) >> 8);
     492    uint8_t c2 = (code & 0xFF);
     493    if (c1 >= 0xe0)
     494    {
     495      c1 = c1 - 0x40;
     496    }
     497    if (c2 >= 0x80)
     498    {
     499      c2 = c2 - 1;
     500    }
     501    if (c2 >= 0x9e)
     502    {
     503      c1 = (c1 - 0x70) * 2;
     504      c2 = c2 - 0x7d;
     505    } else
     506    {
     507      c1 = ((c1 - 0x70) * 2) - 1;
     508      c2 = c2 - 0x1f;
     509    }
     510    /*読み出し*/
     511    readFontJIS(c1, c2);
     512    /*表示*/
     513    sendDotsToSerial32();
     514  }
     515}
     516}}}
     517
    430518=== 付録 ===
    431519