Tiny Sideways Tetris On A Business Card

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.

14 thoughts on “Tiny Sideways Tetris On A Business Card

  1. “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.

    1. 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…

    1. 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.

  2. 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.

Leave a Reply to michmichCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.