MicroPlot on the PyPortal - progress and frustration
Update: I got a fix within minutes of posing the problem on the Adafruit discord channel!
The problem is now solved,
MicroPlot now runs well on the Adafruit PyPortal and Clue as well as the Pimoroni Pico Explorer base, but I've been tearing my hair out trying to solve a problem saving bitmaps.
The bitmap problem
The code creates the plot and then uses the screenshot code that Adafruit provides.
What works, what doesn't?When I first wrote about MicroPlot it ran on the Pico. The code worked but I knew it would need refactoring as I extended it to cover other plot types and other devices.
I soon discovered that bitmap files could use different ways of encoding colour, and the simplest, smallest format created monochrome bitmaps. I soon got a Bitmap file-saver working reliably on the Pico. As you can see, it works, and you can find the code in the MicroPlot project on GitHub.Adafruit colour bitmap saver code and adapted it to run on the Pico. As you can see, it too worked well.
When I ran the unmodified Adafruit code on the PyPortal, it scrambled the image, as shown earlier.
I've checked that I am using the latest production versions of the Adafruit code. Can anyone suggest what I'm doing wrong? The code (mine and Adafruit's) looks sensible, but it seems to corrupt every screenshot bitmap that I try to take.
If you can spot the problem, let me know in the comments, tweet to @rareblog or respond to my cry for help on Discord.