Skip to content

Commit

Permalink
Merge pull request #674 from ohmtech-rdi/oled-ssd130x-contrast-control
Browse files Browse the repository at this point in the history
Add OLED SSD130x contrast control
  • Loading branch information
ohmtech-rdi authored Mar 29, 2024
2 parents a9cb1aa + d87c2ae commit 5724fc8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/erb/daisy/OledSsd130x.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ class OledSsd130x
void init ();
void update ();

void set_contrast (uint8_t contrast);



/*\\\ INTERNAL \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
Expand Down
15 changes: 15 additions & 0 deletions include/erb/daisy/OledSsd130x.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,21 @@ void OledSsd130x <Width, Height, XOffset, PageOffset, Transport>::update ()



/*
==============================================================================
Name : set_contrast
==============================================================================
*/

template <size_t Width, size_t Height, size_t XOffset, size_t PageOffset, typename Transport>
void OledSsd130x <Width, Height, XOffset, PageOffset, Transport>::set_contrast (uint8_t contrast)
{
_transport.SendCommand (0x81); // Contrast control
_transport.SendCommand (contrast);
}



/*\\\ INTERNAL \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/


Expand Down

0 comments on commit 5724fc8

Please sign in to comment.