8

I'm trying to connect a Wii remote to the Pi and use it in a python script. I've tried XWiiMote, but I can't get it to compile. All of the other libraries for Wiimotes I've found don't even work anymore (Wiican, CWiid). Has anyone had any luck with this? XWiiMote has python bindings, it's perfect.

Ian Hyzy
  • 205
  • 3
  • 8

1 Answers1

3

Start by installing cwiid:

sudo apt-get install python-cwiid

Next set your bluetooth adapter to discoverable mode:

sudo hciconfig hci0 piscan

next open a python console by entering python at the command line.

import the cwiid module:

import cwiid

press 1 and 2 on you wiimote to make it discoverable

then create a reference to the wiimote and save it for later access:

wm = cwiid.Wiimote()

Further details and info on making the connection more reliable are available here.

Steve Robillard
  • 34,687
  • 17
  • 103
  • 109