rm-hull / luma.lcd

Python module to drive PCD8544, HT1621, ST7735, ST7567 and UC1701X-based LCDs
https://luma-lcd.readthedocs.io
MIT License
158 stars 57 forks source link

Changing Backlight Control Pin #74

Closed LouisPi closed 5 years ago

LouisPi commented 5 years ago

I have some pin clashes in my project over GPIO 18 and would like to change the backlight control pin on the ST7735. It seems this pin is used for PWM so GPIO 12 (also PWM) should do the job. Firstly, am I correct and if I am could you please advise me how to change the code to use this pin instead.

Thanks, Louis

Edit - I think I have answered my own question, changing the pin number on this (https://github.com/rm-hull/luma.lcd/blob/master/luma/lcd/aux.py#L23) line should do.

rm-hull commented 5 years ago

Well you've found where you can override it, so in your code just pass in that param.

Likewise, the examples can be run with:

     --gpio-backlight GPIO_BACKLIGHT
                        GPIO pin for backlight (PCD8544, ST7735 devices only)
                        (default: 18)