Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 09:59 19 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : I2C addresses on plus and extreme

Author Message
M1BWS
Newbie

Joined: 13/02/2017
Location: United Kingdom
Posts: 1
Posted: 12:59am 15 Feb 2017
Copy link to clipboard 
Print this post

On Raspberry pi there is a utility in i2c-tools to map all the i2c devices connected. I am a newcomer to MMBasic and I was wondering if anyone written something similar to take the hassle out of trying to find conflicting addresses?
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8605
Posted: 04:49am 15 Feb 2017
Copy link to clipboard 
Print this post

It is trivial to do in Basic

[code]
Sub i2ctest
Local integer i,j
I2C open 400,1000
For i=8 To &H77
I2C read i,0,1,j
If MM.I2C=0 Then Print "found address ",i
Next i
I2C close
End Sub[/code]
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2794
Posted: 05:34am 15 Feb 2017
Copy link to clipboard 
Print this post

Nice one Peter - that is a really useful code snippet
For everything Micromite visit micromite.org

Direct Email: whitewizzard@micromite.o
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024