adafruit / RGB-matrix-Panel

Arduino library and example code for the 16x32 RGB matrix panels in the shop
http://www.adafruit.com/products/420
304 stars 145 forks source link

Read front buffer with getPixel #8

Open robf42 opened 10 years ago

robf42 commented 10 years ago

I've reversed the logic in drawPixel and pointed it at the front buffer rather than the back, so that what's being displayed can be queried. I've been wanting this ability so that I can write a proper Life implementation without having to keep another set of frame buffers (which there just is not enough memory for).

Scott216 commented 10 years ago

So does this mean you don't need a 512 or 1024 byte buffer, you can just "stream" the data to the display? If so, is there an example sketch that uses the frontBuffer method?

robf42 commented 10 years ago

This doesn't change the buffer requirements of the library itself. It adds a method of reading pixels from the front buffer. Reading from the front buffer in order to determine what to write to the back buffer is what I've needed. I can't post any code right now as I'm traveling, but I'll post some next week.

I haven't used the frontBuffer method except in the test program I used to make sure getPixel was working correctly. I'll post that next week also.

PlasticLizard commented 10 years ago

Save me a ton of time, thanks!

rfugina commented 10 years ago

Glad it's been helpful. FYI, I've moved the forked repo to another account, but the pull request still stands...