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

Possible to dim screen? #25

Closed
BamBamF16 opened this issue Jun 29, 2019 · 2 comments
Closed

Possible to dim screen? #25

BamBamF16 opened this issue Jun 29, 2019 · 2 comments

Comments

@BamBamF16
Copy link

BamBamF16 commented Jun 29, 2019

I am using this with an app that doesn't use X. It runs its own touch and screen handlers. However, the normal method for other screens of writing dimming isn't working. For now we are passing those lines of code, but I am wondering if there is anything non-standard relating to screen dimming.

For example at night I want the brightness to be 50% of normal. Where/how do I set this?

@AnthonyDiGirolamo
Copy link

AnthonyDiGirolamo commented Jun 29, 2019

You need to output a PWM signal to the backlight control pin (which is BCM 19). See pinout here. Here's an article about using hardware PWM with the rpi zero.

I gave it a shot and it seems to work. Here's a proof of concept repo you can try: https://gitlab.com/anthonydigirolamo/rpi-hardware-pwm

These values seem to work for me, I'm not sure what freq/dutycycle combination would be exactly 50%.

  • This is very dim: sudo ./pwm 19 1000000 135000
  • This should be max brightness: sudo ./pwm 19 1000000 1000000

More info at: http://abyz.me.uk/rpi/pigpio/cif.html#gpioHardwarePWM

@BamBamF16
Copy link
Author

BamBamF16 commented Jun 29, 2019

I can verify this works and dims my screen as desired.

Jeff

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

No branches or pull requests

2 participants