PythonOS icon indicating copy to clipboard operation
PythonOS copied to clipboard

not running on Raspberry pi with tft display.

Open mvturnho opened this issue 7 years ago • 0 comments

The default PythonOS does not run on RaspberryPi 3 with 3.5 inch display. I solved this by adding to pyos.py in the GUI object before pygame.init()

if( _platform == "linux" or _platform == "linux2"):
            print "is Linux"
            os.putenv ("SDL_FBDEV" , "/dev/fb1")
            os.putenv("SDL_VIDEODRIVER", "fbcon")
            os.putenv("SDL_MOUSEDRV", "TSLIB") 
            os.putenv("SDL_MOUSEDEV", "/dev/input/touchscreen")
            print "init pygame"
            pygame.display.init()
            print "get screen size"
            size = (pygame.display.Info().current_w, pygame.display.Info().current_h)
            print "set screen mode"
            self.screen = pygame.display.set_mode(size, pygame.FULLSCREEN)
            print "Framebuffer size: %d x %d" % (size[0], size[1])

And you need the platform package

from sys import platform as _platform

mvturnho avatar Feb 13 '18 20:02 mvturnho