Posts | Comments

Planet Arduino

Archive for the ‘tetris’ Category

Tetris was as a perfect complement to Nintendo’s original Game Boy when it came out in 1989, and now “Copper Dragon” has been able to fit an entire system for it — sans monitor or speakers — inside of a faux NES controller

Impressively, this feat was accomplished with an Arduino Nano and a few passive components, producing not only very believable grayscale blocks, but also playing the familiar tune to accompany the video.

Two signal pins are used for the gray levels, plus a pin for sync, and video generation is programmed in AVR assembler code. Audio is not just PWM, but a simple DAC circuit created by charging and discharging a capacitor at the video line frequency.

I wanted to build a game console into the case of a small USB game pad (a NES controler look-alike). To make the work a challenge, I wanted to only use an Arduino Nano clocked at 16 MHz and some passive components (diodes are OK) and create the best possible video and audio signal that is imaginable with such restrictions.

As it turned out, a monochrome 288p video signal with 4 gray scales is possible when progamming the controller at machine level. 4-channel music is also possible.

My game of choice is Tetris in a version that comes pretty close to the original GameBoy version with a very similar audio track.

[Michael Pick] calls himself the casual engineer, though we don’t know whether he is referring to his work clothes or his laid back attitude. However, he does like to show quick and easy projects. His latest? A little portable Tetris game for $9 worth of parts. There is an Arduino Pro Mini and a tiny display along with a few switches and things on a prototyping PC board. [Michael] claims it is a one day build, and we imagine it wouldn’t even be that much.

Our only complaint is that there isn’t a clear bill of material or the code. However, we think you could figure out the parts pretty easy and there are bound to be plenty of games including Tetris that you could adapt to the hardware.

The display looks suspiciously like an SSD1306 display which is commonly cloned. so that answers one question. These are just less than an inch of screen, but if you buy them from China that eats up almost half of the $9 budget. The Arduino is probably another $3. The other parts are cheap, but it is easy to imagine you might exceed $9 by a bit if you try to duplicate this.

Just from looking at the video, the code looks a lot like Tiny Tetris by [AJRussel], though there are a few others out there if you look. The rest should be pretty easy to puzzle out. Maybe [Michael] will add a link to the code, a bill of materials, and some specific wiring instructions.

Of course, if you just want Tetris, grab your transistor tester. We’ve even seen smaller versions of Tetris given away as business cards.

Remembering to refill water and coffee cups at regular intervals certainly has to be a challenge for restaurant waitstaff, but not for servers at one diner thanks to Mark Wilson’s “TetrisWaterRun” project.

Wilson’s device takes the form of a miniature arcade cabinet, with two “players” named H2O and JOE controlling Tetris playfields.

As each block drops, some complete a line, while others leave spaces, eventually stacking up to a yellow warning level, along with a red section for overdue. Each game/playfield is started with its interface button, which also lights up intermittently to indicate drink warnings. A buzzer is included, so that there’s even less of an excuse for unfilled drinks. The build was prototyped on an Arduino Uno and now runs on a Nano for space savings, with a 320×480 LCD screen displaying the game.

We have had no shortage of clock projects over the years, and this one is entertaining because it spells the time out using Tetris-style blocks. The project looks good and is adaptable to different displays. The code is on GitHub and it relies on a Tetris library that has been updated to handle different displays and even ASCII text.

[Brian] wanted to use an ESP8266 development board for the clock, but the library has a bug that prevents it from working, so he used an ESP32 board instead. The board, a TinyPICO, has a breakout board that works well with the display.

There are also some 3D printed widgets for legs. If we’re honest, we’d say the project looks cool but the technology isn’t revolutionary. What we did find interesting though is that this is a good example of how open source builds on itself.

Of course, the library does a lot of the work, but according to [Brian] the it has several authors. [Tobias Bloom] started the code, and others have changed the library to draw ASCII characters and to support any display that uses the AdaFruit GFX-style library.

So while the code is simple, the result is impressive and is a result of [Brian] leveraging a lot of code from others — a great example of Open Source in action.

We looked at Brian’s use of this library for a YouTube subscription counter, but a clock has more universal appeal, we think — not everyone has a lot of YouTube subscribers. If you don’t have a life, you might try to recreate Tetris using the game of life.

Cheap character LCD displays are more versatile than we give them credit for. Most of the cheapies have a 5×8 character display, which looks blocky but legible when you have an appropriate font. Where it gets fun is that most of the LCD displays also let you upload custom characters.

Taking this to the extreme, [numeric] abused the user-defined characters to write a tiny game of Tetris that would run in the 10×16 frame that you get when you combine four characters together. It’s tiny, it’s monochrome, and doesn’t play the Troika theme (which may be a good thing), but it’s playable. Check out the video below.

[numeric] has bravely put his code for doing this online (ZIP file) as well. It’s rough, to say the least — he did this in a weekend just for fun. But before you go jumping on him for C code in header files, note that this is pretty cool for a quick hack, and also that as good as the Arduino platform is at getting beginners into coding, it doesn’t teach them how to do things right. We wish our first steps into our own coding looked this cool.

This is Hackaday, and we’ve covered a couple Tetris games before. If an LCD display is too high-tech for you, consider Tetris on a DIY LED matrix. If that’s too small, how about Tetris on a skyscraper? Even HP engineers can’t resist the allure of the tiny bricks. And of course, there’s our badge for Hackaday Belgrade. It’s a simple game, and a great test of your skills on a limited system. What’s your favorite Tetris platform?


Filed under: Arduino Hacks

Cheap character LCD displays are more versatile than we give them credit for. Most of the cheapies have a 5×8 character display, which looks blocky but legible when you have an appropriate font. Where it gets fun is that most of the LCD displays also let you upload custom characters.

Taking this to the extreme, [numeric] abused the user-defined characters to write a tiny game of Tetris that would run in the 10×16 frame that you get when you combine four characters together. It’s tiny, it’s monochrome, and doesn’t play the Troika theme (which may be a good thing), but it’s playable. Check out the video below.

[numeric] has bravely put his code for doing this online (ZIP file) as well. It’s rough, to say the least — he did this in a weekend just for fun. But before you go jumping on him for C code in header files, note that this is pretty cool for a quick hack, and also that as good as the Arduino platform is at getting beginners into coding, it doesn’t teach them how to do things right. We wish our first steps into our own coding looked this cool.

This is Hackaday, and we’ve covered a couple Tetris games before. If an LCD display is too high-tech for you, consider Tetris on a DIY LED matrix. If that’s too small, how about Tetris on a skyscraper? Even HP engineers can’t resist the allure of the tiny bricks. And of course, there’s our badge for Hackaday Belgrade. It’s a simple game, and a great test of your skills on a limited system. What’s your favorite Tetris platform?


Filed under: Arduino Hacks
Mag
28

Mimimalist Arduino Gaming Platform

arduino, arduino hacks, AVR, game, LCD, tetris Commenti disabilitati su Mimimalist Arduino Gaming Platform 

A pretty color LCD screen, an Arduino, a buzzer and a joystick is all you need for a minimalist gaming console for under $20. At least, that’s all [João Vilaça] needed to get this sweet version of Tetris up and running. (He’s working on Breakout right now.)

It’s a testament to the current state of the hardware hacking scene that [João] could put this device together in an afternoon for so cheap, presumably after waiting a while for shipments from China. The 320×240 SPI color TFT LCD screen used to cost twice as much as this whole project did. And wiring it up is a simple matter of connecting this pin to that pin. Almost child’s play.

Equally impressive is the state of open source software. A TFT library from Seeed Studios makes the screen interface a piece of cake. [João] wrote his own sound and joystick code, and of course the Tetris gameplay itself, but it’d be much more than a few weeks’ work without standing on the shoulders of giants. Check out [João]’s Github for the project code and stick with us after the break for a demo video and some of our other favorite Arduino gaming hacks.

 

Now, we’ve seen a whole lot of Arduino-based gaming platforms around here before, and they range from the simplistic black-and-white to the bells-and-whistles of the Gameduino which tacks an FPGA onto your Arduino to enable sprites, awesome sound, and VGA output. But we’ve also got a place in our hearts for simplicity and comprehensibility, and [João]’s device and code has got those in spades.

If you’re ready to push your Arduino skills beyond blinking LEDs, [João]’s game project should be on your reading / building list. We can’t wait to see Breakout.


Filed under: Arduino Hacks
Set
28

Ardubracelet Lets you Play Tetris on your Wrist!

Arduboy, ardubracelet, arduino hacks, ATmega328P, tetris, wrist tetris Commenti disabilitati su Ardubracelet Lets you Play Tetris on your Wrist! 

Tetris on your wrist!

Making your own Tetris game is almost a rite of passage for hackers — [Kevin] has stepped up the game a little by making this awesome-flexible-triple-displayed-Tetris-watch dubbed the Ardubracelet.

At the recent Maker Faire SF our head editor [Mike] got a chance to meet with [Kevin] from Arduboy who told us about some of his upcoming projects — this wearable was one of them!

It features three super bright OLED screens on a flexible circuit board with conductive touch buttons to continue with the minimalist design. Instead of a wrist strap he’s actually made the ends magnetic to hold it in place — did we mention the battery also lasts for over 10 hours?

At the heart of the flexible circuit board is an Atmega328p, which is the same chip used in the Arduboy (a credit card sized GameBoy). This is just the first prototype but he’s planning on making it even better in the future complete with Bluetooth and some 3D printed parts to make it look a bit nicer.


Filed under: Arduino Hacks
Mar
18

Handheld Tetris is Retro and We Love It

arduino hacks, handheld tetris, led hacks, neopixel, Neopixels, tetris Commenti disabilitati su Handheld Tetris is Retro and We Love It 

handheld tetris

[Eduardo Zola] has been playing around with Arduinos, and ever since he started, he wanted to try making a game. Having fond memories of playing Tetris back on Windows 3.1, he decided to try giving a handheld version of it a shot.

He started with two 8×8 Neopixel Matrices due to their simplicity — not to mention the massive library of code available! To make it truly portable, he’s also included a 3.7v 4400mAh lithium ion battery which will keep him gaming for hours. He found a 5-way navigation switch on eBay which makes up the joystick. A small LED bar display tells you what level you’re on, and he’s even included a smaller speaker for music, and a vibrating motor for successfully completed lines in the game!

He borrowed the Tetris algorithm (and added some improvements) from the source code by [Valentin Ivanov], who completed a similar project last fall. Stick around to see a demonstration video of it in action.

We’re still pretty fond of this Tetris playing LED necktie though…


Filed under: Arduino Hacks, led hacks
Feb
13

Update: Tetris Handheld Get PCB and Case

3d printed, 3d Printer hacks, arduino hacks, case, handhelds hacks, LED matrix, tetris Commenti disabilitati su Update: Tetris Handheld Get PCB and Case 

update-handheld-tetris

Check out this sweet-piece of homemade handheld gaming! [Jianan Li] has been hard at work on the project and published the updates in two parts, one that shows off the PCB he had fabbed for the project, and another which details the 3D printed case. This is, of course, is the culmination of the Tetris project we first saw as an incredbily packed, yet thouroughly tidy breadboarded circuit.

We really enjoy the 8-sided PCB design which hosts all the parts and gives you a place to hold and control the unit, all without seeming to waste much real estate. The case itself is quite impressive. The openings for the square-pixel LED matrices (the original design had round pixels) and the bar graphs all have nice bevel features around them. The control area has a pleasant swooping cutout, with blue buttons which stand out nicely against the red. Check out the slider switch by his left thumb. He printed matching covers for this slider, and the two that stick out the bottom. Also on the bottom are female pin headers so that you don’t need to disassemble the case to interface with the electronics.

All of this and more are shown off in the clip after the break.


Filed under: 3d Printer hacks, Arduino Hacks, handhelds hacks


  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook