richardhughes
Posts: 4
Joined: Thu Jun 04, 2015 7:47 pm

Name for button on Astro Pi HAT

Tue Jun 09, 2015 5:14 pm

I haven't been able to find anywhere that states what the name for the centre press of the joystick on the Astro Pi HAT is, in order to use it in code.
I know it will be "if n.button.read(): " for the code to recognise it has been pressed, I just need to know what n is.
Thanks,
:)

User avatar
clive
Forum Moderator
Forum Moderator
Posts: 1013
Joined: Tue Feb 07, 2012 8:19 pm

Re: Name for button on Astro Pi HAT

Tue Jun 09, 2015 5:29 pm

The direction of the joystick is mapped to the cursor keys and the press to "Enter"

https://www.raspberrypi.org/learning/as ... oystick.md

Return to “Astro Pi”