Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added brightness for oled display ssd1306 #681

Closed
wants to merge 1 commit into from

Conversation

waiet
Copy link
Contributor

@waiet waiet commented Aug 3, 2019

Added brightness controll for oled display ssd_1306.
Tested with i2c ssd1306 1.3" and spi ssd1306 2.42"

@davericher
Copy link

Would love to see this go through, could you possibly fix the linting error so it passes the gates?

@glmnet
Copy link
Member

glmnet commented Aug 30, 2019

@waiet thanks for contributing, can you check the build check failure of Travis and fix your code so it is happy to merge?

@@ -29,6 +29,8 @@ class SSD1306 : public PollingComponent, public display::DisplayBuffer {
void set_model(SSD1306Model model) { this->model_ = model; }
void set_reset_pin(GPIOPin *reset_pin) { this->reset_pin_ = reset_pin; }
void set_external_vcc(bool external_vcc) { this->external_vcc_ = external_vcc; }
void set_brightness_(float brightness) { this->brightness_ = brightness; }
// void set_brightness_(optional<float> brightness) { this->brightness_ = brightness; }
Copy link
Member

Choose a reason for hiding this comment

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

Remove commented out code please.

@@ -100,7 +97,7 @@ void SSD1306::setup() {
this->command(0xF1);

this->command(SSD1306_COMMAND_SET_VCOM_DETECT);
this->command(0x40);
this->command(0x00);
Copy link
Member

Choose a reason for hiding this comment

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

What is this change for? Is it required for different brightness settings? Will this prevent some brightness settings from working?

Copy link
Member

Choose a reason for hiding this comment

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

I have an SSD1306 128x64, with this change the lowest brightness are more lower, in any case 0% is visible. Kind of works.

else
this->command(0xCF);
break;
this->command(int(255 * (this->brightness_)));
Copy link
Member

Choose a reason for hiding this comment

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

To fix the lint error, dedent this and the next line by 2 spaces.

@davericher
Copy link

@glment you got this? Would really like to see this implemented, if your not up to the corrections I can take over.

@glmnet glmnet mentioned this pull request Sep 8, 2019
3 tasks
@esphome esphome locked and limited conversation to collaborators Oct 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants