Hi there,
I am in desperate need of some help with this. I am trying to get a small 4 x 4 LED matrix to work with the Tetris codes from http://jocker.tistory.com/164 (the original source codes and a video are available over there) Here are the connections that I have made and other relevant details,
(A) 74HC595s
Shift Register 1 (Pins 1-8)
- Top of LED Matrix (Left to Right): LEDs 1-4 ,
- 2nd Row of LED Matrix (Left to Right): LEDs 5-8.
Shift Register 2 (Pins 1-8)
- 3rd Row of LED Matrix (Left to Right): LEDs 9-12,
- Bottom/Last Row of LED Matrix (Left to Right): LEDs 13-16.
(B) LEDs
I noticed a rollPin in the original code so I have,
- Anodes (+) of LEDs 1-4 connected to Digital Pin 3
- Anodes (+) of LEDs 5-8 connected to Digital Pin 4
- Anodes (+) of LEDs 9-12 connected to Digital Pin 5
- Anodes (+) of LEDs 13-16 connected to Digital Pin 6
(C) Buttons
pinMode(A5, INPUT); //up
pinMode(A2, INPUT); //right
pinMode(A4, INPUT); //left
pinMode(A3, INPUT); //down
These are correct.
(D) A Note
I do NOT want any block rotations at all so I nulled the rest after 0. I just want a single [1][1] block.
Because the original code is meant for a 8x8 LED matrix like one of these (jolliFactory: Bi-color LED Matrix Driver Module DIY Kit), I am terribly confused with how to edit the code accordingly to work with my current setup. I have attached my current edit, which includes the comments by the original author of the Tetris code (Jae Yeong Bae). Can someone help me please? o Thank you~!
(I will scale it up to 8 x 8 after I manage to understand how to fiddle with it properly)
tetrisv2b.ino (23.9 KB)