Digole C2I 3/5v Colour display On Teensy 2.0

Status
Not open for further replies.

toreil

Member
Hi Trying to get a Digole colour display to work on my teensy 2.0.
Using the c2i and adress 27.
when testing for the adress with the c2i adress tester it works fine and reports 27.
When trying one of the examples in the digole example pack it does nothing..

anyone got an Idea???


//************************************************************************

// Digole example code

#define LCDWidth 240 //define screen width,height
#define LCDHeight 320
#define _Digole_Serial_I2C_ //To tell compiler compile the special communication only,

#include <DigoleSerial.h>

//--------I2C setup

#include <Wire.h>

DigoleSerialDisp mydisp(&Wire, '\x27'); //I2C:Arduino UNO: SDA (data line) is on analog input pin 4, and SCL (clock line) is on analog input pin 5 on UNO and Duemilanove



//define draw window
#define DW_X 5
#define DW_Y 8
#define DW_W (LCDWidth - 10)
#define DW_H (LCDHeight - 10)
unsigned char i;
void setup() {
mydisp.begin(); //initiate serial port
mydisp.setBgColor(255); //set another back ground color
mydisp.clearScreen(); //CLear screen
mydisp.setColor(0);
for (i = 0; i < 4; i++)
{
mydisp.setRotation(i);
mydisp.drawStr(0, 0, "TEST"); //print string at 3,0 in draw window
}
delay(1000);
mydisp.setRotation(0); //change screen direction to 1, screen width and screen height exchanged
mydisp.setDrawWindow(DW_X, DW_Y, DW_W, DW_H); //set a draw window left/top:5,8, Height=LCDHeight-15, width=LCDWidth-10
mydisp.setColor(255);
unsigned char j=0;

for (i = 0; i < 16; i++)
{
mydisp.setBgColor(j);
mydisp.setColor(~j);

// mydisp.setBgColor(random(256)); //set another back ground color
mydisp.setRotation(i % 4);
mydisp.cleanDrawWindow();
mydisp.drawStr(0, 0, "TEST"); //print string at 3,0 in draw window
mydisp.print(i);
delay(2000);
j=~j;
}
for (i = 0; i < 4; i++)
{
mydisp.setRotation(i);
mydisp.drawStr(0, 0, "TEST"); //print string at 3,0 in draw window
}
}

void loop() {
// put your main code here, to run repeatedly:

}
 
Sorry, I am still old school and maybe what you have is correct for doing a hex constant...
But this looks wrong to me: DigoleSerialDisp mydisp(&Wire, '\x27');

If it were me I would try: DigoleSerialDisp mydisp(&Wire, 0x27);
 
Hi
Thanks.. Your absolutly right, guess the '\x27' is just an example, and changing it to 0x27 made all the difference..

thanks again

Tore
 
Status
Not open for further replies.
Back
Top