Menu

General Quesitons

jkrah
2013-01-09
2015-04-18
  • jkrah

    jkrah - 2013-01-09

    If you have any questions regarding the use of the library please submit them here and I will try to answer them.

     
  • Dan

    Dan - 2015-02-13

    Hi there!

    I've been playing around with your code and an Advatel TCD226C wallboard. This is a 7x160 3 colour board. Using your standard code it will operate this board. However the lettering is scrunched up and all different colours! I did a little thinking on this and figured the colours must be selected with extra resolution in the rows. This is confirmed by the number of TPIC6595Ns on each section of the wallboard. 10 on each board compared to the 5 on the one you have.

    So I changed LedBoard.h...

    #define FONT_ROWS       7
    #define FONT_COLS       10
    #define LED_ROWS        7
    #define LED_COLS        320
    

    and also doubled the spacing

    I then modified the glcd-font.h file to contain be 10 pixels wide.....small example:

            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,// (space)
        0x00, 0x00, 0x00, 0x00, 0x5F, 0x5F, 0x00, 0x00, 0x00, 0x00,// !
        0x00, 0x00, 0x07, 0x07, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,// "
        0x14, 0x14, 0x7F, 0x7F, 0x14, 0x14, 0x7F, 0x7F, 0x14, 0x14,// #
    

    The above font is made to create Orange by activating the red and the green LED per pixel. This all works fine except... It will not select the correct char from progmem.

    For example to get a '#' I might have to enter a '&', or to get and 'A' I might have to enter a 'F' at the serial input. I have been looking at this piece of code from LEDBoard.cpp thinking the problem lays with in.

    ~~~~~~~~~~~~~~~~~~~~~
    void LedBoard::write_char(uint8_t ch, uint8_t posx, bool state, bool inv) {
    // state = true (pixel on) / false (pixel off)
    // inv = true (inverse display) / false (normal)

    if (posx>=LED_COLS) return;
    if (ch < 32)  ch = 32;
    if (ch > 128) ch = 128;
    ch -= 0x20;
    
    // for each column in the FONT
    for (uint8_t c=0; c<FONT_COLS; c++) {
    
        // NB: font data is stored as colums but we are displaying rows
        uint8_t FontByte =  pgm_read_byte_near(System10x7 + (ch*5)  + c); //(ch*5)
    
        // for each row in the FONT
        for (uint8_t r=0; r<FONT_ROWS; r++) {
            // we always work with LSB of FontBytte (later we rotate it)
            uint8_t nib = (FontByte & 1);
    
            // bit = normal bit on
            bool bit = (nib==1);
    
            // now play with bit according to state and inverse
            if ((bit) && (!state) && (!inv)) bit = false;
            if ((inv) && (state)) bit = ! bit;
    
            // update pixel
            set_pix(posx+c, r,  bit);
    
            FontByte >>= 1;
        }//next r
    }// next c
    

    }
    ~~~~~~~~~~~~~~~~~~~

    If I lock ch*5 to say 100 I get a hash no matter what character entered in the serial input.

    Would you have any ideas to put me on track? This would make your code work on a whole new set of Advatel boards! If theres more information you need let me know. Will gladly provide.

    Thanks
    Dan

     
  • Dan

    Dan - 2015-02-13

    Ha, Typing it all out helped!

    uint8_t FontByte = pgm_read_byte_near(System10x7 + (ch5) + c);
    changed to
    uint8_t FontByte = pgm_read_byte_near(System10x7 + (ch
    10) + c);
    to compensate for wider font!

    That got the font working! I can see some other transition problems now but general display of next seems OK. I'll do some testing

     
    • jkrah

      jkrah - 2015-04-18

      Awesome to see someone using and improving the library.. I have to apologise for not replying (until now) as I did not seem to get any notification that you had posted..

      Very glad to hear you got it working though !!! :-)

       

Log in to post a comment.