A little error in Micro-Readerboard Technical Data webpage

Home Evil Mad Scientist Forums Blog Projects A little error in Micro-Readerboard Technical Data webpage

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #20225
    atommann
    Participant

    In LED Micro-Readerboard, version 2.0: Technical Data, there are two errors in the font table at the end of the page.

    First one:
    P     80     abcdghpu     1100     0001     1001     1001     49561
    Should be abcghpu ( no ‘d’)

    Second:
    R     82     abcghpru     1100     0101     1001     1001     30585

    Should be 50585 instead of 30585

    I checked the source code, it is correct in the code.

    my quick and dirty to calculate the font table:

    #include <stdio.h>
    #include <stdint.h>

    typedef enum segment {
    //A, B, C, D, E, F, G, H, K, M, N, P, S, R, T, U,
    // evil mad science
    G, T, S, U, H, K, M, A, B, N, R, D, E, F, P, C,
    } type_seg;

    struct charset {
        char letters;
        char *lit;
    } list[] = {
        {‘A’, “ghkru”},
        {‘B’, “abcdefmps”},
        {‘C’, “abefgh”},
        {‘D’, “abcdefms”},
        {‘E’, “abefghu”},
        {‘F’, “abghpu”},
        {‘G’, “abdefghp”},
        {‘H’, “cdghpu”},
        {‘I’, “abefms”},
        {‘J’, “cdefg”},
        {‘K’, “ghnru”},
        {‘L’, “efgh”},
        {‘M’, “cdghkn”},
        {‘N’, “cdghkr”},
        {‘O’, “abcdefgh”},
        {‘P’, “abcghpu”},
        {‘Q’, “abcdefghr”},
        {‘R’, “abcghpru”},
        {‘S’, “abdefhpu”},
        {‘T’, “abms”},
        {‘U’, “cdghef”},
        {‘V’, “ghnt”},
        {‘W’, “cdghrt”},
        {‘X’, “knrt”},
        {‘Y’, “kns”},
        {‘Z’, “abefnt”},
        {‘*’, “kmnprstu”},
        {‘ ‘, “”},
        {‘/’, “nt”},
    };

    int main(void)
    {
        int i = 0, j = 0;
        char out;
        uint16_t result = 0;

    for (j=0; j < 29; j++)
    {
        i = 0;
        result = 0;

        while (out = list[j].lit[i++])
        {
            switch (out)
            {
                case ‘a’:
                    result |= 1 << A;
                    break;
                case ‘b’:
                    result |= 1 << B;
                    break;
                case ‘c’:
                    result |= 1 << C;
                    break;
                case ‘d’:
                    result |= 1 << D;
                    break;
                case ‘e’:
                    result |= 1 << E;
                    break;
                case ‘f’:
                    result |= 1 << F;
                    break;
                case ‘g’:
                    result |= 1 << G;
                    break;
                case ‘h’:
                    result |= 1 << H;
                    break;
                case ‘k’:
                    result |= 1 << K;
                    break;
                case ‘m’:
                    result |= 1 << M;
                    break;
                case ‘n’:
                    result |= 1 << N;
                    break;
                case ‘p’:
                    result |= 1 << P;
                    break;
                case ‘s’:
                    result |= 1 << S;
                    break;
                case ‘r’:
                    result |= 1 << R;
                    break;
                case ‘t’:
                    result |= 1 << T;
                    break;
                case ‘u’:
                    result |= 1 << U;
                    break;
                default:
                    break;
            }
        }
        printf(“%c, %d”, list[j].letters, result);
        printf(“n”);
    }

        return 0;
    }

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.