diff options
author | Daniel Friesel <derf@finalrewind.org> | 2021-04-11 18:54:17 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2021-04-11 18:54:17 +0200 |
commit | 040109e17b511253b2e3d8d92c67698a3d45ac18 (patch) | |
tree | c96fe1a64f46acea9b3c63a7b2e6abe90f5cf364 /src/driver | |
parent | f7e8fcede382407ffc616f18ffaffb81235e7d26 (diff) |
ssd1306: Add setContrast and setInvert methods
Diffstat (limited to 'src/driver')
-rw-r--r-- | src/driver/ssd1306.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/driver/ssd1306.cc b/src/driver/ssd1306.cc index 69bd28c..23b938d 100644 --- a/src/driver/ssd1306.cc +++ b/src/driver/ssd1306.cc @@ -30,6 +30,17 @@ void SSD1306::init() } } +void SSD1306::setContrast(unsigned char contrast) +{ + writeCommand(SSD1306_SET_CONTRAST); + writeCommand(contrast); +} + +void SSD1306::setInvert(bool invert) +{ + writeCommand(SSD1306_SET_NORM_INV | invert); +} + void SSD1306::showImage(unsigned char* data, uint16_t length) { uint8_t i; |