I'm doing a project for myself which involves raspberry pico and an oled display. I'm using micropython but I think this is more like a generic python question.
I need to populate the screen with images, the fastest way to do it is to ask the pico to turn on or off every pixel.
I'm super stuck in the project since I know how to transform a bitmap image into a 0/1 grid but the result I have is a string like this:
a = "11111001010101010, 11111001010101010, 11111001010101010, 11111001010101010"
in order for the screen to work I need to build a matrix like this:
b = [
[ 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 1, 1, 0, 0, 0, 1, 1, 0],
[ 1, 1, 1, 1, 0, 1, 1, 1, 1],
[ 1, 1, 1, 1, 1, 1, 1, 1, 1],
[ 1, 1, 1, 1, 1, 1, 1, 1, 1],
[ 0, 1, 1, 1, 1, 1, 1, 1, 0],
[ 0, 0, 1, 1, 1, 1, 1, 0, 0],
[ 0, 0, 0, 1, 1, 1, 0, 0, 0],
[ 0, 0, 0, 0, 1, 0, 0, 0, 0],
]
each array is a line on the screen, 0 for black pixel and 1 for white pixel.
What is the fastest way to transform a string containing rows separated by commas into a matrix like the one above? I spent 10 hours on this, I think it's time to surrender :) Thank you in advance for your answers