galaxyrider
Posts: 33
Joined: Sat Dec 26, 2015 2:36 pm

LEDs staying on

Thu Dec 31, 2015 8:27 am

I got Sense Hat yesterday for my RPi 2 B. I played around with the Python examples that I got when installing it. They ran ok but I couldn't turn the LEDs of after even tough I got the script to stop running using Ctrl c. I had to shut down the Pi and unplug from the mains. Any ideas? Thanks.

galaxyrider
Posts: 33
Joined: Sat Dec 26, 2015 2:36 pm

Re: LEDs staying on

Thu Dec 31, 2015 11:23 am

I found a bit of Python code to clear LEDs on this site. I edited it a bit, which was satisfying, and use it to start with a clear matrix. https://pythonhosted.org/sense-hat/api/

User avatar
DougieLawson
Posts: 40251
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: LEDs staying on

Thu Dec 31, 2015 1:43 pm

Well done, that's exactly what you're supposed to do with those sample pieces of code and your Raspberry. Download, hack, run, hack a bit more until it does what you want.
Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

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

Re: LEDs staying on

Tue Jan 19, 2016 2:58 pm

raise SystemExit in Python will exit your running script and turn all the leds off. It does for me anyway. sense.clear() will do it too.

Return to “Astro Pi”