Author Topic: Random tetrimino (Tetris block) generator!  (Read 8976 times)

0 Members and 1 Guest are viewing this topic.

Offline Spyro543

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1189
  • Rating: +74/-3
    • View Profile
Random tetrimino (Tetris block) generator!
« on: November 01, 2014, 04:19:55 pm »
This is probably the most useless device I have made. It displays random tetriminoes on a 4x2 LED matrix. It has two modes: one where it automatically displays a new tetrimino every few seconds, and one where it requires a button press to display a new tetrimino. It has a PIC18F26K20 for its processor.

EDIT: Some updates and pictures and other fun stuff
I added a blinking effect whenever the tetrimino is changed, and I also added an LED for showing if the timer is activated or not.
Here's a video: https://www.youtube.com/watch?v=Z0nJXMi7fSQ
Here's a better circuit diagram: http://i.imgur.com/zztkk1E.png
And here's the code: http://pastebin.com/aS8vF9ZW
« Last Edit: November 02, 2014, 07:15:11 pm by Spyro543 »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Random tetrimino (Tetris block) generator!
« Reply #1 on: November 01, 2014, 09:15:36 pm »
I like it so far. :D

You should make it so we can rotate blocks :P

Offline Spyro543

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1189
  • Rating: +74/-3
    • View Profile
Re: Random tetrimino (Tetris block) generator!
« Reply #2 on: November 01, 2014, 11:21:54 pm »
That would require 8 more LEDs, and too much programming :P

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Random tetrimino (Tetris block) generator!
« Reply #3 on: November 02, 2014, 01:03:21 am »
It would be cool though, but yeah I understand.

Now imagine a full Tetris game made of LEDs O.O

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Random tetrimino (Tetris block) generator!
« Reply #4 on: November 02, 2014, 03:39:33 am »
Wha, that's looking sweet ^.^

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: Random tetrimino (Tetris block) generator!
« Reply #5 on: November 02, 2014, 07:06:09 am »
It would be cool though, but yeah I understand.

Now imagine a full Tetris game made of LEDs O.O
That has probably been done before. I don't think I have ever heard of analogue tetris before tho. Spyro said in irc that he made this so he and his friend could play tetris on paper :)
If you like my work: why not give me an internet?








Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Random tetrimino (Tetris block) generator!
« Reply #6 on: November 02, 2014, 09:37:04 am »
Wait, Tetris on paper? O.o That must take a long while to play lol and I assume that some of the challenge is removed? :P It sounds like an interesting idea to try, though.

Offline Spyro543

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1189
  • Rating: +74/-3
    • View Profile
Re: Random tetrimino (Tetris block) generator!
« Reply #7 on: November 02, 2014, 01:21:17 pm »
That must take a long while to play lol and I assume that some of the challenge is removed? :P
Yes, but it's the only thing keeping us not bored to death in study hall. :P

Some updates and pictures and other fun stuff
I added a blinking effect whenever the tetrimino is changed, and I also added an LED for showing if the timer is activated or not.
Here's a video: https://www.youtube.com/watch?v=Z0nJXMi7fSQ
EDIT: Here's a better circuit diagram: http://i.imgur.com/zztkk1E.png
And here's the code: http://pastebin.com/aS8vF9ZW
« Last Edit: November 02, 2014, 07:14:43 pm by Spyro543 »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Random tetrimino (Tetris block) generator!
« Reply #8 on: November 03, 2014, 09:38:04 pm »
When I was bored in the study hall, I programmed calculator games. But I had to hold the calc in a way that looks like I am doing school work and calculating so that it doesn't look suspicious :P (although my school work was finished by then, the teacher might not have know and might have thought I'm just slacking off instead of doing it)

Also nice video and update :D