Skip to content

Commit

Permalink
Add OLED SSD130x contrast control
Browse files Browse the repository at this point in the history
  • Loading branch information
ohmtech-rdi committed Mar 29, 2024
1 parent a9cb1aa commit d87c2ae
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 d87c2ae

Please sign in to comment.