How to send data through I2C to microcontroller?

Hello,
How can I send data to microcontroller by I2C ?

thanks.

If you offer enough cash someone might write the code for you.

You might also try posting this question in a more appropriate section, perhaps 'Programming Questions'.

Don

thank you Don, I'm new in arduino, and trying to send some numbers like 5000 from uno to pic18f452 !

thanks again.

On the Arduino end it is the 'Wire' library that is used to communicate with other I2C (aka TWI) devices. You might want to look for programming examples using that library.

Don

If the pic18f452 is the I2C slave, then the Arduino part is easy using the "wire" library.

And you go to the PIC forum to figure out how to use the pic18f452 as an I2C slave, so that makes it really easy for us! :grinning:

wleed75:
thank you Don, I'm new in arduino, and trying to send some numbers like 5000 from uno to pic18f452 !

thanks again.

If this is your first project and you are planning to do much Arduino to other data device tasks consider switching to Due.
Due has some neat hardware options to make data transfer and data transfer emulation easier.
You can do "loopback" tests (in software) , error correction and detection etc.

Be aware that most communication protocols are for limited distance.

I found one of the ways to get familiar with two wire communication is to invest in I2C "enabled" LCD.