1

I'm writing a small application that could run on version one Pi ( mine ) or a version two ( co-workers ) that uses the I2C bus.

Since the I2C bus is different depending on the version, I was wondering how I programmatically detect which is which so neither of us have to mess with changing any settings when we

asked Mar 31, 2013 at 15:05
2
  • It seems like your question was cut off halfway. I recommend editing this post. Commented Mar 31, 2013 at 16:06
  • It seems that the bus is selected through the /etc/modprobe.d/raspi-blacklist.conf file. I assume that you could check which one was commented out? Commented Apr 1, 2013 at 4:22

1 Answer 1

1

Gordon Henderson's wiringPi project includes a function piBoardRev which does what you want; looking at the code, it checks /proc/cpuinfo for a "Revision" line and works on that, so you might find it easier to do the same yourself.

There's a discussion on the Raspberry Pi Forum.

answered Apr 1, 2013 at 21:16

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.