B4R Question rWire Error in Compile for esp8266

KiloBravo

Active Member
Licensed User
Hi,

I am trying to use rWire to write an I2C program to read some data with an esp8266 D1 Mini Pro from WII Nunchuck I am getting this error when I compile it. I did update the rWire for the esp32 board. A while back. Any thoughts on what I am doing wrong ?

C:\0B4X_D~1\B4R_PR~1\NunChuck\Objects\bin\sketch\rWire.cpp: In member function 'void B4R::WireSlave::Initialize(Byte, B4R::SubVoidArray)':
rWire.cpp:35:30: error: invalid conversion from 'void (*)()' to 'void (*)(size_t) {aka void (*)(unsigned int)}' [-fpermissive]
Wire.onRequest(requestEvent);
^
In file included from C:\0B4X_D~1\B4R_PR~1\NunChuck\Objects\bin\sketch\B4RDefines.h:22:0,
from C:\0B4X_D~1\B4R_PR~1\NunChuck\Objects\bin\sketch\rWire.cpp:1:
C:\Users\Owner\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\libraries\Wire/Wire.h:80:10: error: initializing argument 1 of 'void TwoWire:nRequest(void (*)(size_t))' [-fpermissive]
void onRequest( void (*)(size_t) );
 

KiloBravo

Active Member
Licensed User
Well, I was right about one thing, I was doing something wrong ! LOL !!! Thanks Erel !

Once compiled my code ran correctly the first time.
It read all the data from the OEM Nunchuk.

It failed on the knockoff Nunchuk.
I dropped the I2c speed down from 400 khz to 100Khz and the knockoff worked correctly as well.

I am not sure if you folks have messed with the Wii Nunchuk, but I bought a bunch for a few dollars each.
You get a 2 axis joystick, with 2 buttons, and a 3 axis accelerometer in a small hand held package.
It also runs at 3.3v which is great with the ESP8266.

https://www.xarg.org/2016/12/using-a-wii-nunchuk-with-arduino/


https://www.dx.com/p/wired-nunchuck-controller-for-wii-u-black-80cm-cable-2024275#.XIpj_LgpBIA

https://www.dx.com/p/wii-wiichuck-nunchuck-adapter-for-arduino-blue-2017136#.XIpkPrgpBIA
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…