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?

up vote 8 down vote accepted
+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.

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

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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