【发布时间】:2017-12-30 09:05:53
【问题描述】:
我刚得到一顶圣诞节的感觉帽,我正在通过以下网站工作:https://projects.raspberrypi.org/en/projects/getting-started-with-the-sense-hat。在做网站的操纵杆部分时,我输入了以下代码:
from sense_hat import SenseHat
sense = SenseHat()
while True:
for event in sense.stick.get_events():
print(event.direction, event.action)
并得到以下错误:
Traceback (most recent call last):
File "/home/pi/python_programmes/hat_short.py", line 4, in <module>
for event in sense.stick.get_events():
AttributeError: 'SenseHat' object has no attribute 'stick'
谁能帮我解决这个问题?
【问题讨论】:
标签: python raspberry-pi joystick