Everyone recognizes Tetris, even when it’s tiny Tetris played sideways on a business card. [Michael Teeuw] designed these PCBs and they sport small OLED screens to display contact info. The Tetris game is actually a hidden easter egg; a long press on one of the buttons starts it up.
It turns out that getting a playable Tetris onto the ATtiny85 microcontroller was a challenge. Drawing lines and shapes is easy with resources like TinyOLED or Adafruit’s SSD1306 library, but to draw those realtime graphics onto the 128×32 OLED using that method requires a buffer size that wouldn’t fit the ATtiny85’s available RAM.
To solve this problem, [Michael] avoids the need for a screen buffer by calculating the data to be written to the OLED on the fly. In addition, the fact that the smallest possible element is a 4×4 pixel square reduces the overall memory needed to track the screen contents. As a result, the usual required chunk of memory to use as a screen buffer is avoided. [Michael] also detailed the PCB design and board assembly phases for those of you interested in the process of putting together the cards using a combination of hot air reflow and hand soldering.
PCB business cards showcase all kinds of cleverness. The Magic 8-Ball Business Card is refreshingly concise, and the project that became the Arduboy had milled cutouts to better fit components, keeping everything super slim.
Tumblr, seriously?
What? It’s a blog.
I’m guessing from your handle you’re a redditor. Glass houses. That place is poison.
Guess again. You are incorrect in your assumption. We have adages for this very situation.
Yeah … a convenient way for blogging. By the way, how is your blog doing? ;)
Inconvenient for sane browsers who care about their privacy and don’t agree to the tumblr idiocy/TOS, which you likely have never looked at.
“The 128×32 OLED using that method requires a buffer size that wouldn’t fit the ATtiny85’s available RAM. To solve this problem, [Michael] avoids the need for a screen buffer by calculating the data to be written to the OLED on the fly. In addition, the fact that the smallest possible element is a 4×4 pixel square reduces the overall memory needed to track the screen contents.”
128 divided by 4 equals 32.
32 divided by 4 equals 8.
32 multiplied by 8 equals 256 pixels.
256 pixels divided by 8 bits equals 32 bytes of storage.
The ATtiny85 has 512 bytes of storage and could easily fit non-bit-compressed pixels with only half the RAM used. With bit-compressed pixels, it’s only 6.25% of the available RAM.
128 x 32 / 8 = 512. He’d have room for exactly that many pixels and no other RAM, if he wanted a bitmapped display.
I suppose if you’re picking at “in addition”, yes, he could’ve held a complete bitmap if he’s only using 4×4 blocks, ie a sixteenth of the available pixels.
Anyway…
But the display won’t be taking 4×4 blocks in, i.e. he has to generate the data to be sent to the display on the fly. Of course upscaling by 4 is easy to do on the fly.
That “upscaling” is kind of how it works. But since there isn’t a direct pixel API if you don’t have a frame buffer, it needed some work to get it the way I wanted.
If you handed that thing to anyone where I work (a major IT company in eastern Poland) – bomb squad would be called and you’d be arrested.
Where would the explosives go? Surely the bomb squad know to ask “are there any explosives” over the phone before they come? A credit-card sized card, made of plastic, just not very dangerous. Maybe you could get a lithium battery to burn you a bit, possibly.
And people say Americans either dont react or overreact. Oh, Boston, erm. Nevermind.
Luckily I live in the Netherlands. No bomb squat yet … ;)
Nice project however non-buffered drawing is quite common for these cheap I2C/SPI displays (doesn’t Arduino lib for Ilitek LCDs do that?). If application retains complete state (in order to restore visuals on screen) or doesn’t perform any blending it can get away with such incremental drawing approach.
Also, I wonder if this project is using “speed hack” for those SSD’s posted on here few days back.
Hi, had a thought for these displays. Make a DIY giant bargraph where they are connected in a stack glass to glass. There will be gaps but as they can be had from defunct vapes and other small electronic items this isn’t as expensive. Adjust brightness in software to get them all balanced.
Multicolour too!