diff options
author | ConfuSomu | 2021-02-07 00:06:55 -0500 |
---|---|---|
committer | ConfuSomu | 2021-02-07 00:06:55 -0500 |
commit | 7213392e7a6a4c98dc78a8802227369caf6debf9 (patch) | |
tree | 868154179719e6127d01b5e7f6d637e0e2cd2957 | |
parent | d113cf3c7c1a0f68a07be26b460a68547fdf34c8 (diff) | |
download | pico-watch-7213392e7a6a4c98dc78a8802227369caf6debf9.tar pico-watch-7213392e7a6a4c98dc78a8802227369caf6debf9.tar.gz pico-watch-7213392e7a6a4c98dc78a8802227369caf6debf9.zip |
Set display contrast in define
This simplfies setting the display contrast. A low value is used to save
a little power and also to have the OLED last a bit longer.
-rw-r--r-- | pico-watch.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pico-watch.c b/pico-watch.c index f1e32af..b5bb792 100644 --- a/pico-watch.c +++ b/pico-watch.c @@ -10,6 +10,7 @@ #define SDA_PIN 6 #define SCL_PIN 7 #define RESET_PIN -1 +#define OLED_DEFAULT_CONTRAST 40 SSOLED oled; // Unused but useful for reference: #define OLED_WIDTH 128 @@ -19,7 +20,7 @@ SSOLED oled; void init_display() { oledInit(&oled, OLED_128x64, 0x3d, 0, 0, 1, SDA_PIN, SCL_PIN, RESET_PIN, 1000000L); oledFill(&oled, 0,1); - oledSetContrast(&oled, 127); + oledSetContrast(&oled, OLED_DEFAULT_CONTRAST); //oledSetTextWrap(&oled, true); } @@ -80,8 +81,7 @@ void show_datetime() { oledWriteString(&oled, 0,0,7, datetime_str, FONT_8x8, 0, 1); } -int main() -{ +int main() { stdio_init_all(); init_display(); init_rtc(); |