6

I wrote a simple script that uses pygame to display the information. However, I found that it won't display on screen when I call it from terminal through SSH. I found this guide/solution on adafruit, but it apparently doesn't work. sudo python pyscope.py does not give me red box on the screen. From console, doing startx & followed by sudo python pyscope.py doesnt work either.

Is there another way to display a pygame window onto the PiTFT from console?

mpromonet
  • 1,124
  • 1
  • 19
  • 38
calccrypto
  • 265
  • 1
  • 8
  • 19

1 Answers1

9

Whichy display are you using to display your graphics? I believe that display 0 is the HDMI output on the Pi.

You'll need to tell pygame to use the TFT:

os.environ["SDL_FBDEV"] = "/dev/fb1"

You can directly call pygame.init() after this. No need to deal with different drivers etc. etc.