Setting Up I2C on your Raspberry pi
Problem:
You have an I2C device that you want to use with your Raspberry Pi, but you don’t know-how.Solution:
In the latest versions of Raspbian, enabling I2C is simply a matter of using the Raspberry Pi Configuration tool that you will find on the main menu under Preferences. Just check the box for I2Cand click OK. You will be prompted to restart.
On older versions of Raspbian, the raspi-config tool does the same job. Start raspi-config using the following command:
$ sudo raspi-configThen select Advanced from the menu and scroll down to I2C
You will then be asked “Would you like the ARM I2C interface to be enabled?”, to which you should say “Yes.” You will also be asked if you want the I2C module loading at startup, to which you should also say “Yes.” At this point, you will probably also want to install the Python I2C library by using the command:
$ sudo apt-get install python-smbusYou will then need to reboot the Raspberry Pi for the changes to take effect. Using I2C modules is actually a really good way of interfacing with the Pi. It reduces the number of wires that you need to connect everything (to just four), and there are some really neat I2C modules available. However, don’t forget to calculate the total of the current used by the I2C modules and make sure that it doesn’t exceed that specified selection of I2C modules available from Adafruit. Other suppliers, such as SparkFun, also have I2C devices. From left to right, there are LED matrix displays; a four-digit, seven-segment LED display; a 16- channel PWM/servo controller; and a real-time clock module
Reference book
Raspberry Pi Cookbook
All raspberry pi Problem And slove Hear
Problem And Slove
Some List of I2C Component on I2C Raspberry pi :
1.Adafruit Stereo FM Transmitter
Your very own pirate radio station with this FM radio transmitter. This breakout board, based on the best-of-class Si4713, is an all-in-one stereo audio FM transmitter that can also transmit RDS/RBDS data!
2.VCNL4010 Proximity/Light sensor:
The VCNL4010 sensor is a nice way to add a small-distance proximity sensor to your microcontroller project. The VCNL4010 is designed for much shorter distances, no more than 200mm (about 7.5"), and under our experimentation, we found it worked best at distances of about 10-150mm. It would be good for say detecting when a hand moved nearby, or before a robot smacks into a wall. The sensor also has an ambient light sensor built-in
3. MCP23008 - i2c 8 input/output port expander:
Add another 8 pins to your microcontroller using an MCP23008 port expander. The MCP23008 uses two i2c pins (these can be shared with other i2c devices), and in exchange gives you 8 general purpose pins. You can set each of 8 pins to be input, output, or input with a pullup. There's even the ability to get an interrupt via an external pin when any of the inputs change so you don't have to keep polling the chip
4. Monochrome 0.96" 128x64 OLED graphic display:
Learn More about I2C Go to https://learn.adafruit.com/i2c-addresses
These displays are small, only about 1" diagonal, but very readable due to the high contrast of an OLED display. This display is made of 128x64 individual white OLED pixels, each one is turned on or off by the controller chip.
Because the display makes its own light, no backlight is required. This reduces the power required to run the OLED and is why the display has such high contrast; we really like this miniature display for its crispness!
This breakout can be used with either an SPI or I2C interface - selectable by soldering two jumpers on the back. The design is completely 5V-ready, with an onboard regulator and built-in boost converter. It's easier than ever to connect directly to your 3V or 5V microcontroller without needing any kind of level shifter!
If you've been diggin' our monochrome OLEDs but need something bigger, this display will delight you. These displays are 2.3" diagonal and very readable due to the high contrast of an OLED display.
This display is made of 128x32 individual blue OLED pixels, each one is turned on or off by the controller chip. Because the display makes its own light, no backlight is required. This reduces the power required to run the OLED and is why the display has such high contrast; we really like this graphic display for its crispness!
If you've been diggin' our monochome OLEDs but need something bigger, this display will delight you. These displays are 2.3" diagonal, and very readable due to the high contrast of an OLED display.
This display is made of 128x32 individual blue OLED pixels, each one is turned on or off by the controller chip. Because the display makes its own light, no backlight is required.
This reduces the power required to run the OLED and is why the display has such high contrast; we really like this graphic display for its crispness!
No comments