We are trying to write a code that starts raspberry pi when you hit the joystick of the sense hat.
Code that acknowledges when joy stick is pressed
from sense_hat import SenseHat
sense = SenseHat()
while True:
for event in sense.stick.get_events():
print(event.direction, event.action
outputs "middle pressed middle released"
Now I need code that when I press middle and release it starts up the raspberry pi or more importantly turns it off.