Posts: 6
Joined: Fri Jun 21, 2013 8:46 am

show_letter combined with set_rotation neads clear

Tue Dec 06, 2016 10:28 pm

I am using the show letter function to display single letters to the sense hat, it works as expected, but I wanted to flip the text upside down so I can leave the raspberry pi standing (otherwise the power cord interferes)

Code: Select all

sense.show_letter('J',text_colour=[255, 255, 255])
I found out that unless I do a clear() from time to time the screen displays weird artifacts (it seems that only half of the screen is rotated)
Is there a reason for this that I have missed?

Posts: 2617
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: show_letter combined with set_rotation neads clear

Wed Dec 07, 2016 11:14 am

Works for me? The only time I have to do a clear is if I terminate my program in the middle of displaying a message. My message is scrolling text. I have mine flipped for the same reason. I want the GPIO on the bottom and power cord on top.

Code: Select all

import os
import time, datetime
from sense_hat import SenseHat
sense = SenseHat()
sense.set_imu_config(False, False, False)
sense.low_light = False

User avatar
Forum Moderator
Forum Moderator
Posts: 1665
Joined: Fri Oct 14, 2011 8:06 pm
Location: The Netherlands
Contact: Twitter

Re: show_letter combined with set_rotation neads clear

Fri Dec 16, 2016 9:50 am

You don't have two python programs running at the same time do you?
If so you would need a call to set_rotation in both, otherwise the other process will still think it's on the default screen rotation.

The set_rotation function also allows you the option to not redraw the screen if you don't want to, for example you can go:

Code: Select all

sense.set_rotation(180, False)

Return to “Astro Pi”