When using digitalio for RGB control on RPi, list values must be more than 1 to actually turn on corresponding LED
taotien opened this issue · comments
pip freeze
Adafruit-Blinka==5.3.2
adafruit-circuitpython-charlcd==3.3.3
Input
import adafruit_character_lcd.character_lcd as characterlcd
import board
import digitalio
lcd_rs = digitalio.DigitalInOut(board.D4)
lcd_en = digitalio.DigitalInOut(board.D19)
lcd_d7 = digitalio.DigitalInOut(board.D27)
lcd_d6 = digitalio.DigitalInOut(board.D22)
lcd_d5 = digitalio.DigitalInOut(board.D24)
lcd_d4 = digitalio.DigitalInOut(board.D25)
lcd_cols = 16
lcd_rows = 2
red = digitalio.DigitalInOut(board.D21)
green = digitalio.DigitalInOut(board.D12)
blue = digitalio.DigitalInOut(board.D18)
lcd = characterlcd.Character_LCD_RGB(
lcd_rs,
lcd_en,
lcd_d4,
lcd_d5,
lcd_d6,
lcd_d7,
lcd_cols,
lcd_rows,
red,
green,
blue)
RED = [1, 0, 0]
GREEN = [0, 1, 0]
BLUE = [0, 0, 1]
lcd.color = GREEN
Expected outcome
LCD backlight is bright green
Actual outcome
LCD backlight stays dark/off
Current workaround
Set values for RED, GREEN, BLUE
to anything more than 1, such as 2, or 100. The outcomes are all the same as long as it's >1.
Overall this isn't much of an issue as pulseio.PWMOut()
has been patched already and works.
@taotien Would you mind retesting this, as lesamouraipourpre I do not have the hardware. Thanks
Sorry for the confusion, but pulseio.PWMOut
was a workaround to a problem with digitalio
(and iirc not recommended in the tutorial), not the issue itself. Unfortunately I have a different hardware issue currently and can't test it either. I would assume that pwmio.PWMout
functions the same as pulseio.PWMOut
.
No problem, thanks for letting us know, we will close now, and it could be re-open if necessary if the problem comes back. Thanks.