• Re: Missing Degree Symbol On Sense Hat

    From Dr Stephen Strange@3:770/3 to Dr Stephen Strange on Friday, December 08, 2023 13:19:24
    Dr Stephen Strange wrote:
    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("https://weather-broker-cdn.api.bbci.co.uk/en/observation/rss/2643266")


    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

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Dr Stephen Strange@3:770/3 to All on Friday, December 08, 2023 12:42:23
    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("https://weather-broker-cdn.api.bbci.co.uk/en/observation/rss/2643266")

    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'

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Anssi Saari@3:770/3 to Dr Stephen Strange on Tuesday, December 12, 2023 16:03:41
    Dr Stephen Strange <no.spam@me.com> writes:

    Dr Stephen Strange wrote:
    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("https://weather-broker-cdn.api.bbci.co.uk/en/observation/rss/2643266")
    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.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Andy Burns@3:770/3 to Anssi Saari on Tuesday, December 12, 2023 17:39:29
    Anssi Saari wrote:

    Dr Stephen Strange writes:

    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

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From The Natural Philosopher@3:770/3 to Andy Burns on Tuesday, December 12, 2023 18:29:01
    On 12/12/2023 17:39, Andy Burns wrote:
    Anssi Saari wrote:

    Dr Stephen Strange writes:

    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?

    --
    Any fool can believe in principles - and most of them do!

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)