Created
July 7, 2012 11:35
-
-
Save lrvick/3065978 to your computer and use it in GitHub Desktop.
Quake3 logger for the raspberry pi that outputs to an attached HD44780 LCD using my library for it
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from hd44780 import HD44780 | |
from os import stat | |
from time import sleep | |
lcd = HD44780() | |
lcd.message(" Quake3 Logger\nCommence killing...") | |
logfile_name = 'game.log' | |
logfile = open(logfile_name,'r') | |
stats = stat(logfile_name) | |
size = stats[6] | |
logfile.seek(size) | |
while 1: | |
where = logfile.tell() | |
line = logfile.readline() | |
if not line: | |
sleep(2) | |
logfile.seek(where) | |
else: | |
if '^7' in line: | |
line = line.replace('^7','') | |
line = line.replace('^2','') | |
line = "%s\n%s" % (line[:16],line[16:32]) | |
lcd = HD44780() | |
lcd.message(line) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LD_LIBRARY_PATH=/opt/vc/lib ./ioquake3.arm 1 &> game.log & | |
sudo python q3lcd.py |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment