I'm trying to figure out some of the I2C stuff. So, say I want to send 0x04 to the register 0xfe on the address 0x53 on a sensor that's plugged into port 1. How would that be accomplished? Well, at least I think that's what I want to figure out. Is that what this code does?

Also, how to receive? If I send 0x00 to address 0x52, and it sends back 6 bytes, how do I read that?

Thanks,

_________________A.K.A. inxt-generationSelf-proclaimed genius, and future world dominator.My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth DoctorBow down to Nikola Tesla, King of the Geek Gods.

Yes, the code I pasted in is Arduino. I want to translate that code to RobotC. I didn't know about your article, will check it out.

_________________A.K.A. inxt-generationSelf-proclaimed genius, and future world dominator.My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth DoctorBow down to Nikola Tesla, King of the Geek Gods.

Yes, in Arduino C/C++, that would indeed send 0x04 to register 0xFE of slave 0x53.

It looks like you are trying to read a Wii extension using an Arduino, in which case I think you mean address 0x52, not 0x53. There are a number of libraries already available for reading e.g. a nunchuk.

Alternately, I would suggest you convert the library that I recently emailed to you.

BTW, the Wire library often used with Arduino C/C++ expects I2C addresses to be 7 bit (bits 0-6) instead of the more common 8 bits (bits 1-7, with bit 0 false).

No, not with an Arduino. I'm trying to read the Wii Motion+, and found some Arduino code for it that I wanted to make sure I was understanding correctly. The copy of the library you sent me does not seem to contain any code for the WM+.

_________________A.K.A. inxt-generationSelf-proclaimed genius, and future world dominator.My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth DoctorBow down to Nikola Tesla, King of the Geek Gods.

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum