diff --git a/hat/ugfx/ugfx.cpp b/hat/ugfx/ugfx.cpp index bb193c3..d2fd157 100644 --- a/hat/ugfx/ugfx.cpp +++ b/hat/ugfx/ugfx.cpp @@ -457,7 +457,6 @@ void surface::box(int x1, int y1, int x2, int y2, uint32_t c) switch(bypp) { case 1: - if(x2 >= x1) { uint16_t t = c&0xff; for(int y = y1; y <= y2; y++) @@ -796,23 +795,34 @@ public: contrast = 120; contrast = 30+contrast/4; // in range unsigned char cmd[] = { - 0xe2, // Soft Reset - 0xc2, // Line scan sequence : from top to bottom - 0x2c, // Boost 1 - 0x2e, // Boost 2 - 0x2f, // Boost 3 - 0xa2, // 1/9 bias ratio + //0xe2, // Soft Reset + //0xc2, // Line scan sequence : from top to bottom + //0x2c, // Boost 1 + //0x2e, // Boost 2 + //0x2f, // Boost 3 + //0xa2, // 1/9 bias ratio - 0x23, // Coarse Contrast, setting range is from 20 to 27 - 0x81, // Trim Contrast - (uint8_t)contrast, // Trim Contrast value range can be set from 0 to 63 - 0xa0, // column scan order : from left to right - 0xa6, // not reverse - 0xa4, // not all on - 0x40, // start of first line + //0x23, // Coarse Contrast, setting range is from 20 to 27 + //0x81, // Trim Contrast + //(uint8_t)contrast, // Trim Contrast value range can be set from 0 to 63 + //0xa0, // column scan order : from left to right + //0xa6, // not reverse + //0xa4, // not all on + //0x40, // start of first line //0xb0, //0x10, - 0xaf // Open the display + //0xaf // Open the display + 0xaf, + 0x40, + 0xa0, + 0xa6, + 0xa4, + 0xa2, + 0xc2, + 0x2f, //enable lcd driving power + 0xf8, //boost circuit setting instruction code + 0x00, //Voltage multiplier as 4x + 0xa0 //set contrast setting }; digitalWrite (dc, LOW) ; // Off