Go Down

Topic: Green Sure 3208 With Miles Burton Library (Read 2283 times) previous topic - next topic

wtwerner

Jul 31, 2013, 02:47 am Last Edit: Jul 31, 2013, 03:17 am by wtwerner Reason: 1
Hello,

I've been working on getting my new Sure 3208 LED Matrix up and running.  I've been able to get it to light up with a couple different libraries so far, but without the correct LED mapping.  It seems whenever I display text on the screen it rotates 90deg and mirrors along the horizontal.  Is this an issue due to the differences between the 3208 and the 0832 or is it a difference between the Red and the Green LED matrices?

I want to get the Miles Burton Matrix Library working with my UNO+3208, but I haven't been able to get anything to light up yet.  I believe I have the correct pins connected and the code is compiling fine, but I can't seem to pinpoint where the issue is coming from.  I saw there is a patch for the green displays on his site, but it seems to be for a much earlier version of the library.  Any help you all could offer would be awesome!  Here's the code I'm using:

https://github.com/milesburton/HT1632

I've also uploaded the documentation for the Sure display.

Thanks!

wtwerner

I've done some more digging and came across an old thread where someone offered up this fix for the green displays:

Code: [Select]
Make sure the calc bit is:

#define CalcBit(y) (1 << (y > 7 ? y -8 : y))

and change these two procedures:

inline uint8_t MatrixDisplay::xyToIndex(uint8_t x, uint8_t y)
{

    // cap X coordinate at 24th column
    x = x > 23 ? 23 : x;
    // cap Y coordinate at 16
    y &= 0xF;
     
#ifdef REDDISPLAY     
      uint8_t addresss = y > 7 ? 1 : 0; // Work out which panel it's on (top:0, bottom:1)
    addresss += x<<1; // Shift x by 1 and add which panel it's on
#endif
     
#ifdef GREENDISPLAY     
      uint8_t addresss = y > 7 ? 1 : 0;
      addresss += (x<<1)^14;

#endif
     
    return addresss;
}

inline uint8_t MatrixDisplay::displayXYToIndex(uint8_t x, uint8_t y)
{
      //old code(red display)
#ifdef REDDISPLAY
            uint8_t addresss = y == 0 ? 0 : (y / 4); // Calculate which quandrant[?] it's in
            addresss += x << 2; // Shift x by 2 and add which panel it's on
#endif
     
#ifdef GREENDISPLAY     
      //new code
      // actual formula for finding display memory adress from the X,Y 
      uint8_t addresss = ((x<<2)^28);
      addresss  += y<4   ? 1 : 0;
      addresss  += y>11  ? 1 : 0;
    addresss  += 7< y >12   ? 1 : 0;
     
     
     
#endif
      return addresss;
}


I tried to make these changes, but it is now having trouble compiling.  When trying to compile the Simple sketch, I get these errors:

Code: [Select]
/Users/wtwerner/Documents/Arduino/libraries/MatrixDisplay_MilesBurton/MatrixDisplay.cpp: In member function 'uint8_t MatrixDisplay::displayXYToIndex(uint8_t, uint8_t)':
/Users/wtwerner/Documents/Arduino/libraries/MatrixDisplay_MilesBurton/MatrixDisplay.cpp:345: error: redeclaration of 'uint8_t addresss'
/Users/wtwerner/Documents/Arduino/libraries/MatrixDisplay_MilesBurton/MatrixDisplay.cpp:342: error: 'uint8_t addresss' previously declared here

wtwerner

Newest update:  I got the Miles Burton library to compile with those additions by adding #define GREENDISPLAY to the MatrixDisplay.cpp file.  I still am unable to display anything on the matrix.  I think it may have something to do with the setup defining the matrix as positive common instead of negative common.  Unless anyone has any advice, I'll work on testing that out.

robtillaart

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)


Go Up