Nokia 5110 Library
Diff: N5110.cpp
- Revision:
- 50:c299b1099189
- Parent:
- 49:93355c01e261
- Child:
- 51:f3b30020324f
diff -r 93355c01e261 -r c299b1099189 N5110.cpp --- a/N5110.cpp Mon Mar 19 13:44:23 2018 +0000 +++ b/N5110.cpp Wed Jan 15 16:41:35 2020 +0000 @@ -59,14 +59,14 @@ reset(); // reset LCD - must be done within 100 ms initSPI(); - setContrast(0.55); // this may need tuning (say 0.4 to 0.6) - setBias(3); // datasheet - 48:1 mux - don't mess with if you don't know what you're doing! (0 to 7) + setContrast(0.5); // this may need tuning (say 0.4 to 0.6) + setBias(5); // datasheet - 48:1 mux - don't mess with if you don't know what you're doing! (0 to 7) setTempCoefficient(0); // datasheet - may need increasing (range 0 to 3) at very low temperatures normalMode(); // normal video mode by default clearRAM(); // RAM is undefined at power-up so clear to be sure clear(); // clear buffer - setBrightness(0.5); + setBrightness(0.1); } // sets normal video mode (black on white) @@ -188,8 +188,8 @@ // function to initialise SPI peripheral void N5110::initSPI() { - _spi->format(8,1); // 8 bits, Mode 1 - polarity 0, phase 1 - base value of clock is 0, data captured on falling edge/propagated on rising edge - _spi->frequency(4000000); // maximum of screen is 4 MHz + _spi->format(8,0); // 8 bits, Mode 1 - polarity 0, phase 1 - base value of clock is 0, data captured on falling edge/propagated on rising edge + _spi->frequency(2250000); // maximum of screen is 4 MHz } // send a command to the display @@ -283,8 +283,8 @@ _sce->write(0); //set CE low to begin frame - for(int j = 0; j < BANKS; j++) { // be careful to use correct order (j,i) for horizontal addressing - for(int i = 0; i < WIDTH; i++) { + for(int j = BANKS-1; j>=0; j--) { // be careful to use correct order (j,i) for horizontal addressing + for(int i =WIDTH-1; i>=0; i--) { _spi->write(buffer[i][j]); // send buffer } }