Community
cancel
Showing results for 
Search instead for 
Did you mean: 
SLast3
Beginner
1,084 Views

How to enable/use i2c?

Jump to solution

Can someone clarify exactly the steps necessary to use i2c on the Edison with Arduino dev board? Is there documentation somewhere that I missed? I'm using the A4/A5 pins on the Arduino board and my sensor (HTU21D-F) is not detected. My understanding is that this corresponds to i2c-6 and that i2c-1 is disabled. Any help would be appreciated. I'm novice, so forgive me if there's not enough detail.

root@edison:~# i2cdetect -y -r 1

0 1 2 3 4 5 6 7 8 9 a b c d e f

00: -- -- -- -- -- -- -- -- -- -- -- -- --

10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

20: -- UU UU UU -- -- -- -- -- -- -- -- -- -- -- --

30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

70: -- -- -- -- -- -- -- --

root@edison:~# i2cdetect -y -r 6

0 1 2 3 4 5 6 7 8 9 a b c d e f

00: -- -- -- -- -- -- -- -- -- -- -- -- --

10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

70: -- -- -- -- -- -- -- --

0 Kudos
1 Solution
Diego_V_Intel
Employee
89 Views

Hi slastname,

If you are using the board from the Arduino side I will suggest you to take a look at the sketch I attached to this post. It is an I2C scanner. I tested it connecting the Edison Arduino board to an Arduino UNO and to a LCD shield too, and it works.

From Linux side, you could use Python. Here is an example of using I2C from Python: https://github.com/MakersTeam/makers-examples/blob/master/Python-Examples/I2Ctest.py makers-examples/I2Ctest.py at master · MakersTeam/makers-examples · GitHub

If you are using I2C from Linux shell, you have to make sure all the mux settings are set correctly. To see more details about the mux settings, please check this page: http://www.emutexlabs.com/project/215-intel-edison-gpio-pin-multiplexing-guide EmutexLabs

Let me know if this answered your question. I hope you find this information useful.

Regards,

Diego.

View solution in original post

3 Replies
Diego_V_Intel
Employee
90 Views

Hi slastname,

If you are using the board from the Arduino side I will suggest you to take a look at the sketch I attached to this post. It is an I2C scanner. I tested it connecting the Edison Arduino board to an Arduino UNO and to a LCD shield too, and it works.

From Linux side, you could use Python. Here is an example of using I2C from Python: https://github.com/MakersTeam/makers-examples/blob/master/Python-Examples/I2Ctest.py makers-examples/I2Ctest.py at master · MakersTeam/makers-examples · GitHub

If you are using I2C from Linux shell, you have to make sure all the mux settings are set correctly. To see more details about the mux settings, please check this page: http://www.emutexlabs.com/project/215-intel-edison-gpio-pin-multiplexing-guide EmutexLabs

Let me know if this answered your question. I hope you find this information useful.

Regards,

Diego.

View solution in original post

SLast3
Beginner
89 Views
idata
Community Manager
89 Views

Hi Diego,

Do you have a scanner that scan i2C1 and i2C6 because your programm seems to works only on i2c6.

Thank you

Paul

Reply