Posts | Comments

Planet Arduino

Archive for the ‘tetris’ Category

You’ve probably played some version of Tetris, but [the Center for Creative Learning] has a different take on it. Their latest version features a cylindrical playing field. While it wouldn’t be simple to wire up all those LEDs, it is a little easier, thanks to LED strips. You can find the code for the game on GitHub.

In all, there are 5 LED strips for a display and 13 strips for the playing area, although you can adjust this as long as there are at least 10 rows. The exact number of LEDs will depend on the diameter of the PVC pipe you build it on.

Using a PS2 controller, the games allow you to play a full-cylinder or in a half-cylinder mode. We were hoping they’d have put up a video showing the gameplay, but we couldn’t find it.

We couldn’t help but think that this would make an excellent display for many purposes. You might even be able to design different games for it.

We’ve seen full-circle Tetris, but it is hardly the same idea. If you want just plain Tetris, you could break out your transistor tester.

There is a boring part of every computer introduction class that shows how a computer is made up of input, output, and processing. Maybe it wouldn’t be so boring if the input device was a nunchuck. [Brian Lough] thinks so and he belligerently asserts that nunchucks are the best input device ever. With a simple connection to a Wii controller and an associated library, you get access to an analog joystick, two buttons, and an accelerometer.

The nunchuck is meant to plug into a Wii controller and the connection is I2C, so that’s trivial to interface to an Arduino or other small microcontroller. The only issue is making the connection. We might have just snipped the wires, but [Brian] prefers to use a small breakout board that plugs into the stock connector and provides solder points for your own cable. There are options for the breakout boards, and [Brian] has his own design that you can get from OSHPark for about a buck for three boards. You can also just jam wire into the connector, but that’s not always robust.

The controllers use 3.3V which isn’t unusual these days. There’s an available library that makes reading them easy. Obviously, not all applications will be a natural fit, but we did like them on the Tetris game [Brian] created. It is also natural for any kind of motion control like his gimbal mount example.

Even if you don’t have junk Wii controllers hanging around, they are common enough on the resale market and you can buy new third-party controllers without spending much. Makes us sorry we threw away ours in the last move.

If you want to get serious hacking a nunchuck, you can go full custom. Or, just give up, and turn one into a Raspberry Pi.

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


  • 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