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()
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()
def main(argc, argv): boy = Pypboy('Pip-Boy 3000', config.WIDTH, config.HEIGHT) logging.info("RUN") boy.run()
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()