I'm having a little trouble using the accelerometer data using cwiid. I know there's already an answered question on this, but the solution wouldn't work, and because I can't comment, I have to make a new question.
I'm using cwiid to make a turtle move in different directions, and everything else is fine, it's just this last stretch I can't figure out. It specifies the roll=(wm.state[etc." as the problem, but I put every other line concerning the accelerometer just in case. The report says roll=(wm.state['acc'][0]-125) KeyError: 'acc'
import cwiid, time, turtle, matplotlib
roll=(wm.state['acc'][0]-125) **# <--Trouble here**
pitch=(wm.state['acc'][1]-121)
try:
wii=cwiid.Wiimote()
time.sleep(3)
except:
exit()
if (buttons & cwiid.BTN_B):
if (roll < -5):
turtle.seth(0)
turtle.back(2)
if (roll > 5):
turtle.seth(0)
turtle.forward(2)
if (pitch > 5):
turtle.seth(90)
turtle.forward(2)
if (pitch < -5):
turtle.seth(90)
turtle.back(2)
time.sleep(button_delay)