PDA

View Full Version : Porting Digole LCD library to Teensy 3



JBeale
10-29-2012, 10:18 PM
Has anyone tried porting the Digole LCD/OLED display library to Teensy 3? Specifically this one:
http://www.digole.com/images/file/Tech_Data/DigoleSerial.zip

It compiles OK for Arduino Uno and for Teensy 2, but not for T3. There were a few simple things to fix like using PROGMEM, but I'm stuck in DigoleSerial.h which (when called with _Digole_Serial_SPI_ defined) reads in part:

class DigoleSerialDisp : public Print {
public:
void begin(void) { }
DigoleSerialDisp(uint8_t pin_data, uint8_t pin_clock, uint8_t SS) //spi set up

The error reads as follows:

In file included from DigoleLCDAdapaterDemo.ino:8:
C:\Program Files\arduino101T\libraries\DigoleSerial/DigoleSerial.h:66: error: expected ',' or '...' before numeric constant
and line 66 in DigoleSerial.h is the DigoleSerialDisp() definition above, but the problem is I can't see any numeric constant there!

You can also configure the library to use serial or I2C interfacing, instead of SPI. All three variations compile for Arduino Uno, and all three fail to compile for T3, although in different ways in each case. I somewhat expected serial to fail as the hardware is entirely different from Arduino, but I'm hoping to get SPI working.

UPDATE: looks like renaming SS to SlaveSelect fixes this problem, I guess it was #defined somewhere. Remaining issue is use of pgm_read_byte_near()

UPDATE2: OK, just commenting out the places pgm_read_byte_near() is used, that is DigoleSerialDisp::drawBitmap(), uploadStartScreen() and uploadUserFont() in DigoleSerial.cpp enables the library to compile on T3. When my display arrives, I'll see if it actually works!

Is there an equivalent to PROGMEM on Teensy3? ...I assume not, we need to use "FlexMemory" of some sort?