Display 2 + PicoW with LED_RGB

Hi, this is my first post so I hope it’s in the right place.

When I initially run the PicoW and Display, the LED_RGB is at low intensity, meaning that I can see the display properly. After running the demos the intensity is too high for comfortable viewing. The keyword information on GitHub does not ( that I can see ) provide a means to reduce the intensity, is this correct? If it is not correct can you point me in the right direction please.

I do believe
from pimoroni import RGBLED
led = RGBLED(6, 7, 8)
and
led.set_rgb(0, 0, 0)
will turn it off.
If that helps.

Hi alphanumeric, thanks for the quick response, I had tried a lot of combinations but I think I had commented out the “led = RGBLED(6, 7, 8)” which initializes the led variable so the following “set” instruction was not followed.
Cheers

Yeah, if you don’t configure it, it lights up dim. Something to do with those pins not being configured. And then depending on what example file you run, it can light up full brightness.

I’ve just been playing with it, the instructions and the display. I thought that I understood it after 20 or so trials but it’s not as straight forward as it should be.

“led.set_rgb(1, 1, 1)” definitely controls the brightness (PWM? 0-100 for each setting can be used ) and the other “led = RGBLED(6, 7, 8)” is necessary to allow it to function ( setting this over 10 seems to affect the brightness of the screen backlight) but there are combinations where it just makes the screen go black and further information with separate, settings,colours and display updates will not be shown.

Once it goes down the black screen route it needs to be hard reset.

Thanks for the help, at least I can see the screen now without it “Burning my Eyez”

Cheers

led = RGBLED(6, 7, 8) sets what pins are used to control the RGB LED. Pin 6 controls the Red LED, etc. You don’t play with those numbers once set.
led.set_rgb(0, 0, 0) is what sets the brightness / color. The values used are 8 bit, 0 to 255. 0 is off and 255 is max brightnes.
led.set_rgb(255, 0, 0) is red at full brightness,
led.set_rgb(0, 255, 0) is green at full brighness.
led.set_rgb(0, 0, 255) is blue at full brightness.

The LCD Screen brightness is a seperate function from this.
display.set_backlight(1.0) is I believe what sets how bright it is. 1.0 is full bright, 0.5 would be half brightness.

Hi alphanumeric,
I should have looked at the schematic I might have picked up that 6, 7, and 8, represented the Red Green and Blue pins and not a colour setting.

I tried the pwm up to 255 but could not see a difference in brightness above 100, it was to bright.

I am familiar with the display brightness setting but thanks for including it as I might not have been.

I’m using 80 for my RGB LED. I use it to indicate if my PICO is on Battery or USB powered.

Hi alphanumeric
I like that idea, I’ll use it myself, thank you

I’m going to start a new support post regarding the “math” module as it is giving me wrong answers.

Thanks again

I see from the above posts that
led = RGBLED(6, 7, 8) assigns the Red, Green, Blue LEDs to pins 6, 7, 8 respectively, and
led.set_rgb(100, 140, 255) sets the intensity of the RGB leds (0…255)

Which works and is fine, however, rather than searching through a forum for basic elementary and necessary info about off the shelf hardware is there a specific document which lists parameters of these and other functions/classes.

Also, in the enviro+ demo there is the line, at line 21
led = RGBLED(6, 7, 10, invert=True)

Does anyone know what the ‘invert=True’ is used for and are there anymore parameters?

Thanks

Some RGB LEDs are common Cathode and some are common Anode. That chages the way they work and wether you use a Hi (3,3V) to turn them on, or a Lo (ground) to turn them on.
Polarity wise, Anode is + and Cathode is - on a diode / LED.

invert=True lets you easily reverse the logic to compensate.

Thanks alphanumeric. I could not find this information and so may I ask from where you found this actual parameter spec as there must be much more valuable info for people such as me who do not know where to look and Google does not find it.
Is there a document/book which lists every function/class/parameter for MicroPython (for Pico W) as developed by Pimironi. I see examples in their excellent demos but there is no document to show what the authors have carefully created. Any lists would be gratefully received and studied.
Thanks

I’m a retired Electronic Technician, that still likes to tinker with electronics. I’m no stranger to through hole components. ;)
LED - RGB Common Cathode (pack of 5) - Pimoroni
SMT is just a different package. Electronically they are the same.
Which one you get, common cathode or common anode, affects how you wire it up, and what signal you use to turn it on.

As far as code goes, it doesn’t know which one is there. The code just turns a GPIO pin Hi or Lo. There were a few posts where the code was supposed to turn the LED on, but it turned off. And vice versa. That thingamabob had the other type of RGB LED.
Adding the invert=True to the Pimoroni RGBLED Library let you fix it by just adding one line to your code.
Finding detailed info on “some” of this stuff can “sometimes” be hard.
Lots of info here though.

pimoroni/pimoroni-pico: Libraries and examples to support Pimoroni Pico add-ons in C++ and MicroPython. (github.com)

Thanks alphanumeric… ditto, I started in electronics in the 60s and grew up from using 4-bit micros - and still carry on, albeit at a much slower pace! Standard or SM hardware holds no fears as I still design PCBs, but what is perplexing me deeply is my lack of documentation whilst experimenting with the really exellent Pimoroni range, specific to their custom micropython. Maybe the authors of their specific version will one day issue a book. I will certainly buy it!

Where did you locate that you could add the ‘invert=True’ to Pimoroni’s library as that is really the answer I am searching for so I can go there and not rely on other people stepping in to help.

In the meantime back to looking at the various demos and relying on the good and high standard of help on this forum. Thanks for the link.

Incidentally I posted another query about reading pixel data elsewhere in the forum and wonder if you have seen it or have any ideas?

Thanks, Steve

If memory serves me, this is what went on. The libraries for the various packs did everything needed for that Pack, graphics, RGB LED etc. They were getting bloated and there was a lot of redundancy. Pimoroni decided to split some stuff up so they could have a universal library that would work on multiple packs. This helped keep the size of the uf2 file down, they were running out of space. This is where PICO Graphics came from. LEDRGB and the Button functions etc are now each a separate universal library that can be used on multiple packs etc.
Some packs have common Anode RGB LEDs, and some have common Cathode. The invert function made life easier, example file wise. It was one of those, you see it mentioned, and make note of it for latter use. ;)

That’s interesting info about the history of the libraries, thanks

@ SteveA @ alphanumeric

Hi, to both of you, after my last post here I’ve spent some time looking around for information on Display_2 320x240 but also with anything that helps me learn the full extent of the MicroPython language.

Information on Display_2 is hard to find and it is not always something that is immediately useful. Looking around on this forum I found another post (Tutorials) regarding tutorials that appears redundant and replied just asking for a list of keywords as it is, for the people who need to produce it, the least effort for the most benefit.

What I’ve found;

Raspberry Pi have a very active Pico/PicoW forum and very good documentation on their product and on the RPi MicroPython they use. But very little on the Display_2 or the other products that rely on the display driver ST77889.

MicroPython have a very active forum (I subscribed and had very nearly 300 emails of posts in 3 days) Most of which went over my head as in not a programmer in C/C++ or Python yet!
MicroPython also have their own WiKi giving a list of Keywords and working through them plus a list of features supported for specific boards, the Pico information being available here ( rp2 — functionality specific to the RP2040 — MicroPython latest documentation)
Standard MicroPython library’s - MicroPython libraries — MicroPython latest documentation
More modules from the Python standard library, as well as further MicroPython extensions to it, can be found here - Glossary — MicroPython latest documentation

Adafruit did/got the original work done on producing a driver for the Display_ 2 (320x240 pixels) by Tony DiCola and had it modified to work with the ST7735 by Clement Skau. Pimoroni have done work on updating the ST7789 driver to version 0.0.4 by a hard-fork from “ST7735-Python” which was modified to include support for their 160x80 SPI LCD breakout (https://travis-ci.com/pimoroni/st7789-python.svg?branch=master) Full text can be seen in the ReadMe.txt file of the library folder in the ST7789-Python-Master.zip file found here - GitHub - pimoroni/st7789-python: Python library to control an ST7789 240x240 1.3" TFT LCD display.