5월, 2020의 게시물 표시

Creating TetrisClock using OpenCV #2

이미지
Implementing text tetris In the previous article, you learned how to implement numbers. This time, I will port the character tetris implemented by Brian Lough to Python in https://github.com/toblum/TetrisAnimation/blob/master/src/TetrisLetters.h . It is not very different from the previous number implementation. You only need to port the values ​​of the fall_instr_let structure that makes up the character. Original code analysis Character Analysis You can find out by looking at https://github.com/toblum/TetrisAnimation/blob/master/src/TetrisLetters.h for Tetris character. This header file contains information that can represent the characters from ascii code 33 (!) To ascii code 90 (Z) in tetris. // // ASCII characters // // ********************************************************************* // ascii 33 - ! // ********************************************************************* fall_instr_let a33[ 5 ] = { { 0 , 0 , 2 , 16 , 0 }, { 2 , 5 , 3 , 13 , 2 }, {

Creating TetrisClock using OpenCV #1

이미지
Do you know TetrisClock? TetrisClock is a WiFi clock made of falling tetris blocks. Runs on an ESP32 with an RGB LED Matrix. <TetrisClock on the RGB LED Matrix by Brian Lough> I'm a big fan of RGB LED matrix and I wrote many posts about RGB LED Matrix in my blog . I like to display the screen using OpenCV on the Raspberry Pi to the RGB LED Matrix. However, the TetrisClock shown in the figure above works on the Arduino family of ESP32 MCUs. I also posted a post implementing TetrisClock on ESP32 at https://iot-for-maker.blogspot.com/2020/04/led-9-rgb-led-matrix-drive-with-esp-32.html . But I wanted to implement this beautiful clock in Raspberry Pi, so I googled hard, but couldn't find any good examples. Eventually, I decided to analyze the code written in C language and implement it in Python and OpenCV. In the picture above, it consists of four large numbers indicating hours, minutes and small letters indicating morning(AM) and afternoon(PM). Original code analysis Number