Missing Degree Symbol On Sense Hat

Dec 08, 2023 Last reply: 2 years ago 4 Replies

I am just starting to get to grips with a Sense Hat I have recently bought. (My coding skills are very limited)



I am trying to get it to display local weather using an rss feed.



This is my script



import feedparser from sense_hat import SenseHat



sense = SenseHat()



d = feedparser.parse("

formatting link
") print (d.feed.title)



for post in d.entries: print (post.title) sense.show_message(post.title)


It works fine but instead of a degree symbol a ? mark is displayed. It seems the dgree symbol is missing from the sense hat.



It there anyway to filter the output and either strip the degree symbol or subtitute it with the word 'degrees'


In answer to my own question

sense.show_message(post.title.replace("°","'"))

Works

If it works for you, great. Otherwise you might want to set your locale so that the degree symbol can actully be printed.

I think the "hat" might have limited character set/bitmap fonts (it's display is just an 8x8 grid of LEDs

I had that problem with a ''7 segment" font...I cheated by dropping into IIRC ARIAL font for the '°'...

If I had time I would edit that font...

But if the device won't display it, there's no point in sending it, is there?

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required