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


{ 7 comments… read them below or add one }

Mohamed Safaa April 5, 2012 at 11:03 am

Hey, I’m working on the same project but using Arduino uno ATMEGA 328, we don’t use I2C as Arduino chip supports 3.3 volt so we connects it directly to the camera and awfully we have no output of the camera, the output of the camera coordinates is just zeros..
My question here, should I use I2C, or may I use pin 3.3 volt in Arduino?
Another question if I have LTC 4300A is it an alternative for LTC 4301 L ?

Sean Nealon December 8, 2012 at 2:26 am

I am new with arduino code and need help declaring A4 and A5 from the digital for 12c.

Saurabh Datta February 13, 2013 at 10:37 am

As Adam McDonald said that we can use the pro mini 3.3v series for there will be no logic level conversion, I just wanted to know that:

1. Did you connectd the SDA & SCl of camera to Analog pin4 & pin5 respectively?
2.How to connect the CLK pin of the camera to the the pro mini (Is it mendatory to connect the CLK).
3. VCC & GND of camera to the VCC & GND of Arduino pro mini 3.3v.

I’ve not connected the CLK pin & currently carrying out the test with a bidirectional logic level converter between Arduino Uno & the pixart camera for SDA & SCL lines & 3.3v VCC & GND. It’s showing “0” as the co-ordinates of the blob.

I’m not sure how to connect the clock. Is it to be logic leveled low to0 for connection? or we can connect it directly some how to the arduino’s clock as now we know that the arduino’s clock can drive it.

Saurabh Datta February 13, 2013 at 10:46 am

Also I’m having this problem that I’ve extra pins SP+ & SP-. Got them from ebay.in.
Should I just leave them unconnected or ground them ?

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.

{ 4 trackbacks }

Previous post:

Next post: