rust-embedded-community / ssd1306

SSD1306 OLED driver
Apache License 2.0
300 stars 68 forks source link

Brightness change #121

Closed bugadani closed 4 years ago

bugadani commented 4 years ago

Hi! Thank you for helping out with SSD1306 development! Please:

PR description

Some open questions that I still have:

So for now, this is only a draft.

bugadani commented 4 years ago

I believe the various display properties need some thought here. I prefer the closure method for setting them, because it doesn't require implementing the same functionality in like 3 places ( one impl and 2 forwarders in the display modes), but your request is totally sensible. Should I include other properties in the common set (i.e. the trait)?

bugadani commented 4 years ago

I've copied the rtfm_dvd example and set it up so when the logo hits the sides, the brightness changes. Unfortunately, I have no hardware to test it.

I'm still leaving this as draft, because I just don't like the 2 parameter implementation (omitting precharge period 1 was an arbitrary choice, for example), it doesn't feel... exact.

bugadani commented 4 years ago

I really don't have a better idea of how to implement this in a somewhat nice manner, so I'm marking the PR as ready.

jamwaffles commented 4 years ago

I just merged #126 so if you can give this a rebase I'll approve and merge once the build passes.

jamwaffles commented 4 years ago

The build is failing with some unused/not found errors.

Once fixed, you can try running TARGET=thumbv7m-none-eabi ./build.sh on your PC to test things before pushing if you want.

bugadani commented 4 years ago

Ah yes, I renamed change_brightness to set, but forgot the example... Oh well

bugadani commented 4 years ago

That's better

jamwaffles commented 4 years ago

Thanks!