Sets the brightness (0=off, 255=brightest)
| 686 | // Sets the brightness (0=off, 255=brightest) |
| 687 | // |
| 688 | void obdSetContrast(OBDISP *pOBD, unsigned char ucContrast) |
| 689 | { |
| 690 | if (pOBD->type == LCD_HX1230) |
| 691 | { // valid values are 0-31, so scale it |
| 692 | ucContrast >>= 3; |
| 693 | obdWriteCommand(pOBD, 0x80 + ucContrast); |
| 694 | } |
| 695 | else if (pOBD->type == LCD_NOKIA5110) |
| 696 | { |
| 697 | // we allow values of 0xb0-0xbf, so shrink the range |
| 698 | ucContrast >>= 4; |
| 699 | obdWriteCommand(pOBD, 0x21); // set advanced command mode |
| 700 | obdWriteCommand(pOBD, 0xb0 | ucContrast); |
| 701 | obdWriteCommand(pOBD, 0x20); // set simple command mode |
| 702 | } |
| 703 | else // OLEDs + UC1701 |
| 704 | obdWriteCommand2(pOBD, 0x81, ucContrast); |
| 705 | } /* obdSetContrast() */ |
| 706 | |
| 707 | // |
| 708 | // Special case for Sharp Memory LCD |
no test coverage detected