示例#1
0
sys.path.append ( 'pypboy/modules/items')
sys.path.append ( 'pypboy/modules/stats')


# 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 as 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()
示例#2
0
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()
示例#3
0
文件: main.py 项目: lelandg/pypboy
def main(argc, argv):
    boy = Pypboy('Pip-Boy 3000', config.WIDTH, config.HEIGHT)
    logging.info("RUN")
    boy.run()
示例#4
0
文件: main.py 项目: amolloy/pypboy
import pygame
import config
import os
import confuse
if config.gpioAvailable():
    import gpiozero

if config.gpioAvailable():
    driver = config.user_config['video']['driver'].get()
    print("Using driver %s" % driver)
    os.putenv('SDL_VIDEODRIVER', driver)

    fbdev = config.user_config['video']['fbdev'].get()
    os.putenv('SDL_FBDEV', fbdev)
else:
    print("GPIO UNAVAILABLE")

from pypboy.core import Pypboy

if __name__ == "__main__":
    if config.user_config['audio']['enabled'].get():
        try:
            pygame.mixer.init(44100, -16, 2, 2048)
        except:
            config.user_config['audio']['enabled'] = False

    boy = Pypboy('Pip-Boy 3000')
    boy.run()