forked from sabas1080/pypboy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
30 lines (25 loc) · 725 Bytes
/
main.py
File metadata and controls
30 lines (25 loc) · 725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import pygame
import config
import os
# Init framebuffer/touchscreen environment variables
os.putenv('SDL_VIDEODRIVER', 'fbcon')
os.putenv('SDL_FBDEV' , '/dev/fb1')
os.putenv('SDL_MOUSEDRV' , 'TSLIB')
os.putenv('SDL_MOUSEDEV' , '/dev/input/touchscreen')
try:
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
config.GPIO_AVAILABLE = True
except Exception, e:
print "GPIO UNAVAILABLE (%s)" % e
config.GPIO_AVAILABLE = False
from pypboy.core import Pypboy
try:
pygame.mixer.init(44100, -16, 2, 2048)
config.SOUND_ENABLED = True
except:
config.SOUND_ENABLED = False
if __name__ == "__main__":
boy = Pypboy('Pip-Boy 3000', config.WIDTH, config.HEIGHT)
print "RUN"
boy.run()