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?

1 Answer 1

9
+50

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.

1
  • Well well well... you have earned a lot of reputation in 2 days. Keep up the good work.
    – syb0rg
    Commented Dec 30, 2013 at 19:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.