Pixart/Wiimote sensor library for Arduino

by Stephen Hobley on March 1, 2009

I just finished the first pass of the C++ object library for accessing the WiiMote/Pixart sensor from an Arduino. A simple example included with the library.

(With a quick appearance by my daughter…)

You do need to desolder the sensor and hook up a control circuit for I2C before you can use it. Like this.

The seeing Arduino type thing…

Just a first pass – all feedback greatly appreciated.

Download Library


{ 53 comments… read them below or add one }

Rupak August 3, 2013 at 1:38 am

Why does it say read() is not the member of the class when I compile my program in the arduino IDE ?

Lucas August 16, 2013 at 3:27 pm

I’m having a problem with the programming when I check before writing to the Arduino. The error that appears is:
“Class PVision has no member named ‘read’”
I do not know what can be done to fix this problem, and have not tried to save the program ignoring this error.
I wonder if there is any solution for this case.

Excuse any errors on my English is not my native language …

Valentin August 1, 2014 at 8:11 am

I know this topic is quite old but I got exactly the same issue as yours Rupak and Lucas, and I will post the solution in case someone would face the same issue.
After searching on the internet it appears that some fonctions and library were renamed after an update of Arduino and the compiler will no longer understand old ones.
You have to make the following changes in the file PVision.h and PVision.cpp.
In PVision.h:
=> #include “WConstants.h” becomes #include “Arduino.h”
=> replace every occurence of the word “byte” by the word “uint8_t”
In PVision.cpp:
=> replace every occurence of the word “byte” by the word “uint8_t”
=> replace every occurence of the function “send” by the function “write”
=> replace every occurence of the function “receive” by the function “read”
Save changes in both files and ensure that the PVision.h and PVision.cpp files which are in the “librairies” folder of your sketchbook are the new ones (corrected by you). If no, replace it or re-import the PVision library from Arduino IDE.
Mr Hobley’s example code should now compile.
Best regards,

Leave a Comment

Comments links could be nofollow free.

{ 8 trackbacks }

Previous post:

Next post: