Brightness ssd1306 (#723)

* added brightness for oled display ssd1306

* lint


Co-authored-by: waiet <vlado.rusnak23@gmail.com>
This commit is contained in:
Guillermo Ruffino
2019-10-17 11:36:11 -03:00
committed by Otto Winter
parent 81b7653c9c
commit 428684bc1e
4 changed files with 11 additions and 7 deletions
@@ -79,10 +79,7 @@ void SSD1306::setup() {
case SH1106_MODEL_128_64:
case SSD1306_MODEL_64_48:
case SH1106_MODEL_64_48:
if (this->external_vcc_)
this->command(0x9F);
else
this->command(0xCF);
this->command(int(255 * (this->brightness_)));
break;
case SSD1306_MODEL_96_16:
case SH1106_MODEL_96_16:
@@ -100,7 +97,7 @@ void SSD1306::setup() {
this->command(0xF1);
this->command(SSD1306_COMMAND_SET_VCOM_DETECT);
this->command(0x40);
this->command(0x00);
this->command(SSD1306_COMMAND_DISPLAY_ALL_ON_RESUME);
this->command(SSD1306_NORMAL_DISPLAY);