Skip to content

Conversation

antonok-edm
Copy link
Contributor

When browsing through the API, I was surprised it's not possible to change the brightness of these displays, but it turns out it just wasn't exposed here yet 😄

I've tested this on my own SH1106 display and it appears to work pretty well. It does look like the driver could be fine-tuned to show even darker content using the precharge period? But I'm not familiar with how that works, and the helpful link @limpkin posted to relevant documentation on that issue appears to be dead. The brightness range is sufficient for my own use case in the meantime though.

@limpkin
Copy link

limpkin commented Apr 29, 2020

hello @antonok-edm , which doc are you referring to? :)

@antonok-edm
Copy link
Contributor Author

@limpkin the one you posted on the issue I linked to: olikraus/u8g2#98 (comment)

No worries if you can't find it though - it's been a few years!

Copy link
Collaborator

@jamwaffles jamwaffles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I'll test this later when I have some hardware to hand.

In the meantime, can I ask you to add a changelog item to CHANGELOG.md please? Something like the following should be fine:

## [Unreleased] - ReleaseDate

+ ### Added
+ 
+ [#20](https://github.com/jamwaffles/sh1106/pull/20) Add `set_contrast` method to set the display contrast/brightness.

@limpkin
Copy link

limpkin commented Apr 29, 2020

oh right damn it.... I didn't even copy locally that pdf, which I remember to be really well made

@jamwaffles
Copy link
Collaborator

Tested on a physical device with STM32F103 and works great. Just missing the changelog item and I can get this merged in :)

@antonok-edm
Copy link
Contributor Author

@limpkin Oh well. Thanks for checking!

@jamwaffles I updated the changelog.

@jamwaffles jamwaffles merged commit 3a6a000 into rust-embedded-community:master Apr 30, 2020
@jamwaffles
Copy link
Collaborator

Sorry for the delay. This is released in v0.3.2 🎉

@antonok-edm antonok-edm deleted the set-contrast branch April 30, 2020 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants