Hi to all!
I'm testing my new LCD, a 128x64 with controller ST7920, (model 12864ZW). I've wired it as follow on my arduino:
PIN 1 on LCD [VSS] to Ground
PIN 2 on LCD [VDD] to 5V (via ardiuno)
PIN 4 on LCD [RS] to D10 (arduino)
PIN 5 on LCD [R/W] to D11 (arduino)
PIN 6 on LCD [E] to D13 (arduino)
PIN 15 on LCD [PSB] to Ground
I've opened the "Hello World" example code on the u8glib library and enabled the following line for the communication:
U8GLIB_ST7920_128X64 u8g(13, 11, 10, U8G_PIN_NONE); // SPI Com: SCK = en = 13, MOSI = rw = 11, CS = di = 10
Now, I can see the "Hello World" example but it's really really dark and difficult to see. It's up to insufficient power? O do I need to set-up/wire something other? (contrast?)
The power is supplied by the 5V PIN on Arduino connected on USB PC. I've tried to use an USB adapter (220V->5V (1A) ) but with the same result.
What's wrong?
Thank's a lot!
Simon
hello world example:
#include "U8glib.h"
// setup u8g object, please remove comment from one of the following constructor calls
U8GLIB_ST7920_128X64 u8g(13, 11, 10, U8G_PIN_NONE); // SPI Com: SCK = en = 13, MOSI = rw = 11, CS = di = 0
void draw(void) {
// graphic commands to redraw the complete screen should be placed here
u8g.setFont(u8g_font_unifont);
//u8g.setFont(u8g_font_osb21);
u8g.drawStr( 0, 22, "Hello World!");
}
void setup(void) {
// flip screen, if required
// u8g.setRot180();
// set SPI backup if required
//u8g.setHardwareBackup(u8g_backup_avr_spi);
// assign default color value
if ( u8g.getMode() == U8G_MODE_R3G3B2 )
u8g.setColorIndex(255); // white
else if ( u8g.getMode() == U8G_MODE_GRAY2BIT )
u8g.setColorIndex(3); // max intensity
else if ( u8g.getMode() == U8G_MODE_BW )
u8g.setColorIndex(1); // pixel on
}
void loop(void) {
// picture loop
u8g.firstPage();
do {
draw();
} while( u8g.nextPage() );
// rebuild the picture after some delay
delay(500);
}