Introduction: Tetris Clone With OLED SSD1306(I2C) for Arduino Nano / Uno

This Instructable is about getting Tiny Tetris running on a 128x64 OLED display using an Arduino Nano or Uno.

Step 1: What You Need.

Arduino Nano or Arduino Uno:






AD Analog Keyboard Module

Note: other key pads and switch configurations could be used but you would need to change the code.

Some cables to connect things:


Step 2: Uno Wiring

Uno wiring:

Note: the key pad shown represents the pad in the parts list, I have not built the one shown but if you did it would be easy to get it working, only a few small changes would be needed in the code.

Fritzing Part

Step 3: Nano Wiring

Nano wiring:

Note: the key pad shown represents the pad in the parts list, I have not built the one shown but if you did it would be easy to get it working, only a few small changes would be needed in the code.

Fritzing Part

Step 4: The Code

If you are new to Arduino have a look at this to get started:

How to have fun with Arduino

Code attached and on GitHub below:

Code on GitHub - this has the most up to date code including Art work and Sound!

There is still a lot to be done with the code, see below:

High score functionality.

[Done] Better key pad control code.

Decent random number generator.

[Done] Start thinking about adding sound.

Create a letter font, create a proper system for rendering numbers and letters.

Tidy up code and optimize for memory, sort out the globals and types.

Create defines for all the magic numbers but they are useful for now.

Step 5: Have Fun!


KunI3 made it!(author)2017-03-28

hello, badfeed. i have a question, if the change the lcd like that? how to program that?

thank you

BADFEED made it!(author)2017-03-29


I don't know anything about that display and I imagine the system for comunicating with it is different to the SSD1306.

Sorry I can be of more help.

good luck with it though, nice looking display..

BADFEED made it!(author)2017-03-15


Can you put my Git Hub link in your source code.

I don't think you are giving enough credit; the game is not "by you" you optimised and ported the game to a ATtiny.

In your source code you say: Some of the game code is Copyright (C) 2016 Anthony Russell, that's not good enough.

The reason you ported this game of Tetris for the SSD1306 and not others is because I found a fast way of drawing a 6x6 block on the screen.

Also Tobozo put a lot of work into this game and created all the art work -which you have no problem using, and he gets no credit.


andyhighnumber made it!(author)2017-03-15

Ok - all done - the version in my repo now 100% attributed to you, tobozo and others.

Sorry it took a bit to spot this - been at work all day.

Please check and let me know whether you're happy with the level of attribution now.

andyhighnumber made it!(author)2017-03-16

Just to set the record straight Anthony - I'm very disappointed to see all that action on Twitter - although I do appreciate your message, the damage is done. It seems like your Twitter account (and another one - Timinius?) was specifically set up to give me grief. Why do you think I would post on this Instructables page if I wanted to pass your code off as mine?

Not all of the code in the #AttinyArcade version that I published is yours and right from the start your work was credited/attributed via your copyright notice, referring-to your name and your copyright statement for the Lesser GPL (the whole point of this licence is to do exactly what I did - re-use code and make it clear who had modified it). Porting your code to the smaller platform (8k Flash, 512 bytes RAM) meant that I had to reduce both code footprint and memory use by almost half, which was 20+ hours work and required major re-design of significant parts of the code as well as addition of new functionality. I agree that Tobozo should also have been credited - that opening graphic is really neat! I feel bad about that and it was sorted within 3 minutes of me seeing your post here when I got in from work.

I'm always so excited to see anyone using my code anywhere - whether and however I'm credited - as you will have seen from my Twitter feed, this happens in loads of different ways. I'm sad to say that the reaction on Twitter has left me with a bad feeling about this project. I've now deleted the port from my repository and won't be revisiting it.

BADFEED made it!(author)2017-03-16


my twitter account was set up years ago, just used for one tweet, it was not set up to grief you, Timinius is nothing to do with me.

Its seemed to me you were passing the game off as yours and giving minimal credit, its normal to provide a link to git hub or the creators repository.

I'm sure you put a lot of work into the port but you used significant portions if the existing code and artwork, that all took a long time write and put together.

Look I'm sorry about Twitter, I overrated -I know very little about it and did not think the tweets would cause so much damage, I was just trying to tweet what I wrote above but with the char limit that was a load of tweets, also when I seen no reply I though you were ignoring me or deleting them or whatever..

I'm sad things have gone this way, I put the game out there exactly so people would use it for this kind of thing.

Lintang_Wisesa made it!(author)2017-01-07

It's awesome! I made it w/ joystick/thumbstick controlled, demo:

BADFEED made it!(author)2017-01-07

Cool :)

Good job getting the thumb stick working with it!

SarahH25 made it!(author)2016-12-13

another christmas present idea!

DIY+Hacks+and+How+Tos made it!(author)2016-09-17

Fun project for teaching people about Arduinos and displays.

About This Instructable




More by BADFEED:Tetris Clone with OLED SSD1306(I2C) for Arduino Nano / Uno
Add instructable to: