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

PicoGraphics error with 1Bit pen #728

Closed
dajames-mk1 opened this issue Mar 24, 2023 · 0 comments
Closed

PicoGraphics error with 1Bit pen #728

dajames-mk1 opened this issue Mar 24, 2023 · 0 comments
Labels
[- breakout -] https://shop.pimoroni.com/collections/breakout-garden [- pico graphics library -] c++ This issue or request relates to C++ code

Comments

@dajames-mk1
Copy link

dajames-mk1 commented Mar 24, 2023

I have a breakout garden 1.12" mono OLED display connected to a Pi Pico. I tested it using the oled_128x128_demo.cpp example program.

I imagine that the expected output is a white screen with the string "PIRATES!" in black bouncing around. (It would be really nice to have a short video of the expected output so that we can check correct operation). What I actually got was "PIRATES!" in black bouncing around on a background of white dots on black -- not easy to read!

It turns out that the code

        graphics.set_pen(1);
        graphics.clear();

doesn't set all the pixels in the rectangle of the full display to white, but only one pixel in 16. I tried setting the pen to 15 and achieved a white background, which gives the display I expected.

Clearly setting a 1-bit pen value to 15 is a nonsense. There is an error somewhere in the rectangle fill code for PicoGraphics_Pen1Bit.

EDIT: Sorry, I've just reread the documentation page for Pico Graphics and see that your 1-bit pen is supposed to work this way(!) As that's the case I suggest that the example could be improved by setting the pen colour to 15 (as I did) as the text is very hard to discern against a dithered background.

@helgibbons helgibbons added [- pico graphics library -] [- breakout -] https://shop.pimoroni.com/collections/breakout-garden c++ This issue or request relates to C++ code labels Mar 24, 2023
@thirdr thirdr closed this as completed Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[- breakout -] https://shop.pimoroni.com/collections/breakout-garden [- pico graphics library -] c++ This issue or request relates to C++ code
Projects
None yet
Development

No branches or pull requests

3 participants