Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can slave of i2c send data to master? #9

Open
khoindq opened this issue Jan 28, 2016 · 3 comments
Open

Can slave of i2c send data to master? #9

khoindq opened this issue Jan 28, 2016 · 3 comments

Comments

@khoindq
Copy link

khoindq commented Jan 28, 2016

Hi all,
i would like to use i2c to send data from a slave to master, how can I achieve that,
I read that using wire request can solve those problem . However I dont know how to use that with easy transfer

@MG-Arnaud
Copy link

Hello,
I have the same problem of you and I have found a solution that I can share if someone else would do the same thing :
You just have to define an adress of the MASTER, like that : Wire.begin(I2C_MASTER_ADDRESS); and you send your slave data to this adress and it's work perfectly : ET.sendData(I2C_MASTER_ADDRESS);
And in your master code you wait the reception with this code if(ET.receiveData()){...}.
If you have question don't hesitate. I hope that can help and sorry if my English is not very good (I am French :-D ).

P.S : I attach an example where I send data in both direction Master to slave and Slave to Master and the data have a type different (float, int, boolean) !

I2C_example_MS&SM.zip

@r0oland
Copy link

r0oland commented Apr 1, 2018

Thanks a lot ArnaudProjetAPP, you probably just save a few hours of my life!
I think this should def. be included in the examples!

@MG-Arnaud
Copy link

Hello r0oland, you're welcolme :-)
Thank you for your comment, it makes me happy if I could help you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants