I2C is a communication bus designed by Philips, for chips to communicate with each other on a PCB. It is commonly used, however, for connecting sensors, such as the two examples later in this instructable and port expanders, because you can have multiple devices on the same two pins.
Remove these ads by
Signing UpStep 1: Install R-Pi Image
http://www.raspberrypi.org/downloads
There is an easy setup guide on the wiki, just follow it through.
When you have got it installed, run the config tool, and get everything going nicely. In my case, I am running it headless via SSH, which is enabled as default, at pi@192.168.0.X (check on your router to find the IP).










































Visit Our Store »
Go Pro Today »




bear2 = bus.read_byte_data(address, 3)
bear = (bear1 << 8) + bear2
bear = bear/10.0
return bear....
why do you divide by 10? I am assuming you have a signed 15 bit number and you are getting rid of the last 0? Why not use >> 1?
Otherwise it would not run..
http://elinux.org/RPi_Tutorial_EGHS:Communicating_With_Other_Micro-controllers
Includes: the official (probably overkill) way of interfacing 3.3V and 5V I2C applications, software for a few languages, and kernel considerations.
Range sensor sounds fun, I'll give that a try!