PythonOS
PythonOS copied to clipboard
not running on Raspberry pi with tft display.
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