[12864/SSD1306] Play Snake on Raspberry Pi

System Monitor for Raspberry Pi with 12864/SSD1306, and you can download all the files from GitHub.

Demo
Demo

Setting Up
Configure your 128464 by following this tutorial: https://learn.adafruit.com/ssd1306-oled-displays-with-raspberry-pi-and-beaglebone-black/usage?view=all

# Ports used for the Display. You may have to change them to yours
RST = 25
DC = 24
# Configurations of this game
# You may check the preference below and alter the values if you want
display_interval = 0.05                # Refresh display every 0.05 second => FPS = 20
size = 2                               # Size of a snake, 2 means one point occupies four pixels (2x2)
# Initialize the boundary of the gaming area
area = (0, 0, disp.width*2/3/size-1, (disp.height-2)/size-1)    # Gameing area in points with size
boundary = (0, 0, (area[2]+1)*size+1, (area[3]+1)*size+1)       # Gameing boundary
boundary_cross = True                  # snake is able to cross the boundary 
# Block setting
block_mode = False                     # Do not create blocks
# Initialize a snake
snake = []                             # snake
snake0 = (area[2]/2, area[3]/2)        # snake's head (first pixel)
snake1 = snake0                        # snake's tail (last pixel)
l = 4                                  # snake's length = 4
interval_max = 1
interval_min = 0.05
interval = interval_max                # move the snake every 1 second
direction = (1, 0)                     # direction = Right
food = snake0                          # normal food
food_score = 1                         # each food worth 1 score
sfood = ()                             # initialize a empty special food
sfood_lifetime = 10                    # special food exists for 10 seconds
sfood_count = 0                        # to count the time of the special food
sfood_interval = 0.25                  # refresh the special food every 0.25 second
sfood_time = 30                        # Possible to generate a special food every 30 seconds
sfood_score = 5                        # each special food worth 5 scores
blocks = []                            # blocks for blocking the snake
scores = [0, 10, 50, 100, 150, 250, 350, 550, 750, 950, 1200]
levels = [0, 1,  2,  3,   4,   5,   6,   7,   8,   9,   10]
score = 0
level = 0

How to Use

# Run directly with diffculity = 0
sudo python snake.py
# Run directly with diffculity = 1
sudo python snake.py 1
# Run directly with diffculity = 2
sudo python snake.py 2

How to Play
Control: Press ‘w’, ‘a’, ‘s’, ‘d’
Speed up/remove effect: Press ‘q’
Exit game: Press ‘x’

License
—-
MIT

[12864/SSD1306] System Monitor for Raspberry Pi

System Monitor for Raspberry Pi with 12864/SSD1306, and you can download all the files from GitHub.

Demo
Demo

Modules
Adafruit_GPIO.SPI
Adafruit_SSD1306
psutil

Setting Up
Configure your 128464 by following this tutorial: https://learn.adafruit.com/ssd1306-oled-displays-with-raspberry-pi-and-beaglebone-black/usage?view=all

sudo apt-get install python-pip
sudo pip install psutil
# Ports used for fthe Display. You may have to change them to yours
RST = 25
DC = 24

How to Use

sudo python disp.py

License
—-
MIT

[12864/SSD1306] Video Player

It is a python script for playing videos on 12864 over SPI sockets, and you can download all the files from GitHub.

Demo

Modules
Adafruit_GPIO.SPI
Adafruit_SSD1306

Setting Up
Configure your 128464 by following this tutorial

sudo apt-get install python-pip
sudo apt-get install python-pygame
sudo pip install opencv-python
# Ports used for the Display. You may have to change them to yours
RST = 25
DC = 24

How to Use

# sudo python player.py file_path
# Play BadApple.zip
sudo python player.py BadApple.zip

Convert a video
I provided a m file for matlab for converting videos while you can also convert any videos with opencv

[TicFirm] a tool for sniffing Ticwatch Firmware!

The tool is still in its alpha stage as some functions may not work as expected, such as the alpha firmware discovery.
这是一个可以用来为Ticwatch 抓取 Ticwear 刷机包的工具,当前还在测试阶段,很多功能尚未实现,比如Alpha版的固件不能很好的获取。

Warning: this tool is only used for test purpose. Be aware of what you are doing with your watch, and I will not be responsible for breaking your device.
警告:该工具只用作测试意图。请想清楚了再刷机,对于由任何该工具造成砖机之类的问题概不负责。如见目前不支持新出的手表如 Ticwatch S, E之类,切记。

Test Results:
1. Ticwatch2 international version -> Ticwath2 Chinese version: Succeed!
2. Ticwatch2 Downgrade to 4.8: Succeed!
3. Ticwatch2 switch version manually: Succeed!

测试结果:
1. Ticwatch2 海外版刷国内版的固件:成功
2. Ticwatch2 刷低版本固件(如4.8):成功
3. Ticwatch2 版本切换(开发板->正式版):成功

Steps:
1. Download your ROM, rename it to “update.zip” and place it in the root folder of sdcard of your watch,
2. Go to develop mode and update manually, wait for around 30 secs for the watch to process.
3. Reset your device after flashing a ROM.

刷写步骤:
1. 下载你需要的固件并重命名为“update.zip”,然后将改固件拷贝至手表存储的sd卡根目录
2. 进入开发者模式,点击手动升级即可。手表大约需要几十秒的时间来配置环境,请耐心等待即可
3.刷完后最好重置下手表。

Current Version / 当前版本: 0.2
Download Link / 下载链接: TicFirm v0.2

Ver 0.2:
– Updated most firmware links;
– Added support for all release & beta ROMs.
– Fixed bugs.
Ver 0.1:
– Achieved basic features.

Screenshot: