fawcett
Posts: 2
Joined: Thu Jun 01, 2017 4:00 am

Sense Hat Joystick Stuck

Thu Jun 01, 2017 4:08 am

I recently purchased a SenseHat, and everything that I had tested until now worked great.

I am in the process of setting up the joystick to trigger a system shutdown. As I started playing with the Sense Hat API, I am finding that my board continually triggers a 'held' action in the 'left' direction. This is with me not touching the input device. Is there a way to calibrate the joystick, or does it sound like I have a defective board?

Thanks!

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

Re: Sense Hat Joystick Stuck

Thu Jun 01, 2017 12:12 pm

Post your code, just to rule out a coding error. IMHO it's not really a joystick. It's more like the hat switch you'd find on a joystick. It's just a 5 way switch. If it was an analog joystick, yes, you would try calibrating it. It sounds like on switch contact is shorted. Have a good look at it physically maybe you'll spot something?

fawcett
Posts: 2
Joined: Thu Jun 01, 2017 4:00 am

Re: Sense Hat Joystick Stuck

Thu Jun 01, 2017 5:44 pm

I was using some of the example code from the Sense Hat API doc pages:

For example:

Code: Select all

from sense_hat import SenseHat
from time import sleep

sense = SenseHat()
event = sense.stick.wait_for_event()
print("The joystick was {} {}".format(event.action, event.direction))
sleep(0.1)
event = sense.stick.wait_for_event(emptybuffer=True)
print("The joystick was {} {}".format(event.action, event.direction))
I got excited today when I tried it again. It waited for stick/button input and printed the correct input type for several tries, and then started to just only print (without touching the stick/button) "held left", even when I pushed the stick in other direction.

I looked at the physical switch and board. No obvious solder or pin issues.

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

Re: Sense Hat Joystick Stuck

Thu Jun 01, 2017 7:00 pm

Yeah, it looks like the stick is defective. I have all 5 functions of mine programed for use. That would mess things up for me royally.

Return to “Astro Pi”

Who is online

Users browsing this forum: No registered users and 2 guests