File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,10 @@ with the [embedded-hal](crates.io/crates/embedded-hal) traits for maximum portab
8
8
9
9
## [ Unreleased] - ReleaseDate
10
10
11
+ ### Added
12
+
13
+ - [ #20 ] ( https://github.com/jamwaffles/sh1106/pull/20 ) Add ` set_contrast ` method to set the display contrast/brightness.
14
+
11
15
## [ 0.3.1] - 2020-03-21
12
16
13
17
### Fixed
Original file line number Diff line number Diff line change @@ -160,6 +160,11 @@ where
160
160
pub fn set_rotation ( & mut self , rot : DisplayRotation ) -> Result < ( ) , DI :: Error > {
161
161
self . properties . set_rotation ( rot)
162
162
}
163
+
164
+ /// Set the display contrast
165
+ pub fn set_contrast ( & mut self , contrast : u8 ) -> Result < ( ) , DI :: Error > {
166
+ self . properties . set_contrast ( contrast)
167
+ }
163
168
}
164
169
165
170
#[ cfg( feature = "graphics" ) ]
Original file line number Diff line number Diff line change @@ -187,4 +187,9 @@ where
187
187
}
188
188
}
189
189
}
190
+
191
+ /// Set the display contrast
192
+ pub fn set_contrast ( & mut self , contrast : u8 ) -> Result < ( ) , DI :: Error > {
193
+ Command :: Contrast ( contrast) . send ( & mut self . iface )
194
+ }
190
195
}
You can’t perform that action at this time.
0 commit comments