Retrieve text (strings) by date

Nice idea but is not working ScruffR.

I do 2 changes:

a.) beam.cpp

    while ( (i<stringLen) && frame < 36 ){

      // pick a character to print to Beam = Original-Libary from Hoverlabs
    //      asciiVal = toupper(text[i]);
    //      if (asciiVal == 32){
    //        fontptr = &charactermap[0][0];   //set fontptr to matching font
    //      } else {
    //        fontptr = &charactermap[(asciiVal-32)][0];   //set fontptr to matching font
    //      }
      
      // Change - Start
      // https://community.particle.io/t/retrieve-text-strings-by-date/32201/19
      asciiVal = toupper(text[i]);
      if ( 32 <= asciiVal && asciiVal <= 64 ) {
        fontptr = &charactermap[(asciiVal-32)][0];   //set fontptr to matching font
      }
      else {
        switch(asciiVal) {
          case 'Ä':
            fontptr = &charactermap[65][0];
            break;
          case 'Ö':
            fontptr = &charactermap[66][0];
            break;
          case 'Ü':
            fontptr = &charactermap[67][0];
            break;
          case 'ß':
            fontptr = &charactermap[68][0];
            break;
          default:
            fontptr = &charactermap[0][0];
            break;
        }
      }
      // Change - End

I delete the () in [(68)].

b.) charactermap.h full listing:

    #include "Particle.h"

    uint8_t charactermap[69][7] = {              
    {0x00,0x00,0xFF,0xFF,0xFF,0xFF},      // SPACE
    {0x17,0x0,0xFF,0xFF,0xFF,0xFF,0xFF},      // !
    {0x3,0x0,0x3,0x0,0xFF,0x0,0xFF},       // "
    {0xA,0x1F,0xA,0x1F,0xA,0x0,0xFF},     // #
    {0x17,0x15,0x1F,0x15,0x1D,0x0,0xFF},  // $
    {0x12,0x8,0x4,0x12,0x0,0xFF,0xFF},     // %
    {0xA,0x15,0xE,0x10,0x0,0xFF,0xFF},     // &
    {0x3,0x0,0xFF,0xFF,0xFF,0xFF,0xFF},       // '
    {0xE,0x11,0x0,0xFF,0xFF,0xFF,0xFF},      // (
    {0x11,0xE,0x0,0xFF,0xFF,0xFF,0xFF},      // )
    {0x5,0x2,0x5,0x0,0xFF,0xFF,0xFF},       // *
    {0x8,0x1C,0x8,0x0,0xFF,0xFF,0xFF},      // +
    {0x10,0x8,0x0,0xFF,0xFF,0xFF,0xFF},      // ,
    {0x4,0x4,0x0,0xFF,0xFF,0xFF,0xFF},       // -
    {0x10,0x0,0xFF,0xFF,0xFF,0xFF,0xFF},      // .
    {0x18,0xE,0x3,0x0,0xFF,0xFF,0xFF},      // /
    {0x1F,0x11,0x1F,0x0,0xFF,0xFF,0xFF},    // 0
    {0x2,0x1F,0x0,0xFF,0xFF,0xFF,0xFF},      // 1
    {0x1D,0x15,0x17,0x0,0xFF,0xFF,0xFF},    // 2
    {0x15,0x15,0x1F,0x0,0xFF,0xFF,0xFF},    // 3
    {0x7,0x4,0x1F,0x0,0xFF,0xFF,0xFF},      // 4
    {0x17,0x15,0x1D,0x0,0xFF,0xFF,0xFF},    // 5
    {0x1F,0x15,0x1D,0x0,0xFF,0xFF,0xFF},    // 6
    {0x1,0x1,0x1F,0x0,0xFF,0xFF,0xFF},      // 7
    {0x1F,0x15,0x1F,0x0,0xFF,0xFF,0xFF},    // 8
    {0x17,0x15,0x1F,0x0,0xFF,0xFF,0xFF},    // 9
    {0xA,0x0,0xFF,0xFF,0xFF,0xFF,0xFF},       // :
    {0xA,0x0,0xFF,0xFF,0xFF,0xFF,0xFF},       // ;
    {0x4,0xA,0x11,0x0,0xFF,0xFF,0xFF},      // <
    {0xA,0xA,0xA,0x0,0xFF,0xFF,0xFF},       // =
    {0x11,0xA,0x4,0x0,0xFF,0xFF,0xFF},      // >
    {0x1,0x15,0x7,0x0,0xFF,0xFF,0xFF},      // ?
    {0x1F,0x11,0x1D,0x15,0x1F,0x0,0xFF},  // @
    {0x1F,0x05,0x05,0x1F,0x00,0xFF,0xFF},  // A
    {0x1F,0x15,0x15,0x0A,0x00,0xFF,0xFF},  // B
    {0x0E,0x11,0x11,0x0A,0x00,0xFF,0xFF},  // C
    {0x1F,0x11,0x11,0x0E,0x00,0xFF,0xFF},  // D
    {0x1F,0x15,0x15,0x15,0x00,0xFF,0xFF},  // E
    {0x1F,0x5,0x5,0x0,0xFF,0xFF,0xFF},     // F
    {0x1F,0x11,0x15,0x1D,0x0,0xFF,0xFF},   // G
    {0x1F,0x4,0x4,0x1F,0x0,0xFF,0xFF},     // H
    {0x11,0x1F,0x11,0x0,0xFF,0xFF,0xFF},   // I
    {0x18,0x10,0x1F,0x0,0xFF,0xFF,0xFF},   // J
    {0x1F,0x4,0x1B,0x0,0xFF,0xFF,0xFF},    // K
    {0x1F,0x10,0x10,0x0,0xFF,0xFF,0xFF},   // L
    {0x1F,0x2,0x4,0x2,0x1F,0x00,0xFF},     // M
    {0x1F,0x2,0x4,0x8,0x1F,0x00,0xFF},     // N
    {0xE,0x11,0x11,0x11,0xE,0x00,0xFF},    // O
    {0x1F,0x5,0x7,0x0,0xFF,0xFF,0xFF},     // P
    {0x1F,0x11,0x15,0x19,0x1F,0x00,0xFF},  // Q
    {0x1F,0x5,0xD,0x17,0x0,0xFF,0xFF},     // R
    {0x17,0x15,0x15,0x1D,0x0,0xFF,0xFF},   // S
    {0x1,0x1F,0x1,0x0,0xFF,0xFF,0xFF},     // T
    {0x1F,0x10,0x10,0x1F,0x0,0xFF,0xFF},   // U
    {0x7,0x8,0x10,0x8,0x7,0x00,0xFF},      // V
    {0xF,0x10,0xC,0x10,0xF,0x00,0xFF},     // W
    {0x11,0xA,0x4,0xA,0x11,0x00,0xFF},     // X
    {0x1,0x2,0x1C,0x2,0x1,0x00,0xFF},      // Y
    {0x11,0x19,0x15,0x13,0x0,0xFF,0xFF},   // Z
    {0x1F,0x11,0x0,0xFF,0xFF,0xFF,0xFF},       //[
    {0x3,0xE,0x18,0x0,0xFF,0xFF,0xFF},        ///
    {0x11,0x1F,0x0,0x0,0xFF,0xFF,0xFF},       //]
    {0x6,0xE,0x1C,0xE,0x6,0x0,0xFF},        //^
    {0x10,0x10,0x10,0x0,0xFF,0xFF,0xFF},      //_
    {0x1,0x2,0x0,0xFF,0xFF,0xFF,0xFF},         //'
    {0x1D,0xA,0x1D,0x0,0x0,0x0,0xFF},      // Ä added
    {0x1D,0x10,0x1D,0x0,0x0,0x0,0xFF},     // Ü added
    {0x1D,0x14,0x1D,0x0,0x0,0x0,0xFF},     // Ö added
    {0x1E,0x15,0x17,0xD,0x0,0x0,0xFF},     // ß added

    };

My beam give me an question mark like this:

May I ask you to look again? Maybe we just have a misunderstanding in communication?

Whether or not the parentheses are there doesn’t make a difference at all.

But I’m not sure what I should make of the question mark, since you haven’t shown what you actually intended to have displayed by the beam.
Also trying different messages and having a “Soll-Ist-Vergleich” would help debugging.

If you prefer we could confer in German in a private message too.

I have also noticed that your patterns for ‘A’, ‘O’ & ‘U’ in the Excel sheet don’t match the original pattern

      {0x1F,0x05,0x05,0x1F,0x00,0xFF,0xFF},  // A
      {0x0E,0x11,0x11,0x11,0x0E,0x00,0xFF},  // O
      {0x1F,0x10,0x10,0x1F,0x00,0xFF,0xFF},  // U

Now that I understand the LED matrix, I quickly converted the original HEX back into a character. In line 1, only my first attempts - for the solution without further meaning (you are right here).

I am still interested in displaying the ‘Losungstext’ with umlauts correctly. In fact, there are only problems here, which the beam acknowledges by the question mark. The date and time are fields without umlauts and are displayed correctly.

  /* JSON Source - https://losungen.klose.cloud/api/today
   {
    "Datum": "2017-05-05T00:00:00",
    "Wtag": "Freitag", 
    "Sonntag": {},
    "Losungstext": "Du sollst dein Herz nicht verhärten und deine Hand nicht zuhalten gegenßber deinem armen Bruder.",
    "Losungsvers": "5.Mose 15,7",
    "Lehrtext": "Wenn jemand dieser Welt Güter hat und sieht seinen Bruder darben und verschließt sein Herz vor ihm, wie bleibt dann die Liebe Gottes in ihm?",
    "Lehrtextvers": "1.Johannes 3,17"
    }

Thanks for the offer of the PM!

I am happy to announce the closure of this thread: the problem with European characters - the so-called umlauts like Ö, Ä, Ü and ß - has come to a good conclusion with support from ScruffR.
The not quite ordinary project that IoT + Religion unites has been documented and awaits your feedback! Thx all!

2 Likes