Hallo
Für einen Linuxday bin ich gerade dabei, ein kleines Projekt zu bauen. Es soll auf einem Nokia 6100 ColorLCD Shield (von elecfreacs) ein paar Sensor-Informationen (Temp, Luftfeuchte, ...) und ein Logo dargestellt werden. Die Sensorwerte sind kein Problem, deshalb auch hier nicht im Code vorhanden.
Das Logo bekomme ich irgendwie nicht hin. Mein Code sieht z.z. so aus:
#include <gLCD.h>
#define BACKGROUND WHITE
#define TEXTCOLOR1 BLACK
#define BACKLIGHTpin 10
const char RST = 8;
const char CS = 9;
const char Clk = 5;
const char Data = 3;
static char logo[1024] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xa0, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff,
0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x1f, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff,
0xff, 0x0f, 0xf8, 0x07, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x03,
0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x00, 0xc0, 0x0f,
0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x7f, 0x00, 0xe0, 0x1f, 0x00, 0x00,
0x00, 0x00, 0xfc, 0xff, 0x3f, 0x00, 0xc0, 0x3f, 0x00, 0x00, 0x00, 0x00,
0xfe, 0xff, 0x3f, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff,
0x1f, 0xe0, 0xbf, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0f, 0xe0,
0x7f, 0xff, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x0f, 0xf8, 0xff, 0xff,
0x01, 0x00, 0x00, 0x80, 0xff, 0xff, 0x0f, 0xfc, 0xff, 0xfe, 0x01, 0x00,
0x00, 0x80, 0xff, 0xff, 0x07, 0xfc, 0xff, 0xfb, 0x01, 0x00, 0x00, 0xc0,
0xff, 0xff, 0x07, 0xfc, 0xff, 0xff, 0x03, 0x00, 0x00, 0xc0, 0xff, 0xff,
0x0f, 0xfe, 0xff, 0xfe, 0x03, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x07, 0xfe,
0xff, 0xff, 0x07, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x07, 0xfc, 0xff, 0xfe,
0x07, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xfd, 0x07, 0x00,
0x00, 0xe0, 0xff, 0xff, 0x07, 0xfc, 0xff, 0xff, 0x07, 0x00, 0x00, 0xe0,
0xff, 0xff, 0x07, 0xfe, 0xbf, 0xfd, 0x07, 0x00, 0x00, 0xe0, 0xff, 0xff,
0x07, 0xfc, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xe0, 0xff, 0x5f, 0x05, 0x54,
0x7f, 0xff, 0x07, 0x00, 0x00, 0xf0, 0xff, 0x07, 0x00, 0x00, 0xf6, 0xfd,
0x0f, 0x00, 0x00, 0xe0, 0xff, 0x07, 0x00, 0x00, 0xdc, 0xff, 0x07, 0x00,
0x00, 0xe0, 0xff, 0x03, 0x00, 0x00, 0x7c, 0xff, 0x0f, 0x00, 0x00, 0xe0,
0xff, 0x07, 0x00, 0x00, 0xf4, 0xff, 0x07, 0x00, 0x00, 0xf0, 0xdf, 0x07,
0x00, 0x00, 0xfe, 0xff, 0x07, 0x00, 0x00, 0xe0, 0x7f, 0x2f, 0x01, 0x90,
0xfe, 0xff, 0x07, 0x00, 0x00, 0xe0, 0xef, 0xff, 0x07, 0xfe, 0xff, 0xff,
0x07, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xff, 0x07, 0x00,
0x00, 0xf0, 0xdb, 0xff, 0x0f, 0xfc, 0xff, 0xff, 0x03, 0x00, 0x00, 0xe0,
0xff, 0xff, 0x07, 0xfe, 0xff, 0xff, 0x03, 0x00, 0x00, 0xe0, 0xfb, 0xff,
0x07, 0xfc, 0xff, 0xff, 0x03, 0x00, 0x00, 0xe0, 0xf7, 0xff, 0x07, 0xfe,
0xff, 0xff, 0x01, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x0f, 0xfc, 0xff, 0xff,
0x01, 0x00, 0x00, 0xe0, 0xf6, 0xff, 0x07, 0xfe, 0xff, 0xff, 0x00, 0x00,
0x00, 0xe0, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xff, 0x00, 0x00, 0x00, 0xe0,
0xf6, 0xff, 0x03, 0xfe, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff,
0x01, 0xfe, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xe0, 0xf7, 0xff, 0x01, 0xff,
0xff, 0x1f, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x3f, 0x00, 0xff, 0xff, 0x1f,
0x00, 0x00, 0x00, 0xe0, 0xef, 0x00, 0x80, 0xff, 0xff, 0x0f, 0x00, 0x00,
0x00, 0xf0, 0x3f, 0x00, 0x80, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0xe0,
0x7f, 0x00, 0xe0, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0xe0, 0x3f, 0x00,
0xe0, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x00, 0xf8, 0xff,
0xff, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x02, 0xff, 0xff, 0x1f, 0x00,
0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x17, 0x00, 0x00, 0x00,
0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
gLCD graphic(RST,CS,Clk,Data,HIGH_SPEED);
void setup() {
pinMode(BACKLIGHTpin, OUTPUT);
analogWrite(BACKLIGHTpin, 1023); // Hintergrundbeleuchtung aktivieren
graphic.begin(0,0,0,PHILLIPS_0);
graphic.Clear();
graphic.Window(0,0,127,127);
for(int i=0 ; i<(sizeof logo) ; i+=3) {
graphic.twoPixels(logo[i], logo[i+1], logo[i+2]);
}
}
void loop() {
}
Anstelle des Logos wird jedoch immer nur das Display blau...
Das Logo hab ich in die Hex-Werte konvertiert, indem ich in gimp ein jpg als xbm abgespeichert habe und diese dann hier eingefügt habe. Die verwendete gLCD-Lib ist von hier: GitHub - TCWORLD/gLCD-Library: Arduino Nokia 128x128 Graphic LCD Library..
Ich wäre um jeden Hinweis oder Links zu Bespielen froh.
Danke
beduine