Skip to content

Add Brightness Slider or buttons #103

Description

@makerplane-jnicol

We will need to add in a brightness control for specific control of the GPIO PWM for the Pi. I know we have also discussed a global brightness control that will dim or brighten the whole panel. Right now we cannot control the brightness of the display from within pyEfis.

Code supplied by Steve to control this follows. Also suggest that it does not dim to 0 as that would be a black screen. Come up to 10 so that the screen can still be seen and not confused with an off screen:

import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.OUT)
pwm=GPIO.PWM(18, 100)
pwm.start(0)

for dc in range(0,110,10):
        print dc
        pwm.ChangeDutyCycle(100-dc)
        time.sleep(1)

pwm.stop()
GPIO.cleanup()

I think that there are two options potentially.

  1. Add a function that can be called from main.yaml to add buttons that increase or decrease brightness similar in function to the BARO +, BARO -. It would be great if the brightness value could be superimposed onto the display in a corner so that the user knows the brightness of the display so that you don't press multiple times to figure out if you are at max brightness. That is annoying.
  2. Create an instrument that is a slider object that can be placed onto a screen.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions