This tutorial uses the distro provided by adafruit, if you dont have the distro up an running re-visit one of my old tutorial on raspberry pi.
Step 1: Parts
SDA >>> SDA
the diagram below is from http://elinux.org/RPi_Low-level_peripherals
Step 2: Tools
sudo i2cdetect -y 0
this will scan all devices connected to the I2C bus. it should look like the pic below. if you see that i2ctools are not installed
run the following comand
sudo apt-get install i2c-tools
sudo apt-get install python-smbus
sudo apt-get install python-pip
sudo pip install rpi.gpio
wget -O geekman-python-eeml.tar.gz https://github.com/geekman/python-eeml/tarball/master
tar zxvf geekman-python-eeml.tar.gz
sudo python setup.py install
note down the address of the I2C device that you have connected. in this case i have connected a temp. sensor PMODTEMP2 from digilent.we use the sumbus function for I2C communcation.
Step 3: Temp. on a Site
to make things easier you can download the git code to home folder. doing the following...
run the code
git clone https://github.com/sajingeo/raspberry-pi-saj.git
to get a copy of my repository on your desktop.
here you will see two files, open the i2cpy.py using nano
read the code for comments, the Adafruit library that is included in the files is very good for I2C operations and should be used to avoid common I2C mistakes...thanks to ADAFRUIT...
you should be able to now embed the temperature graph on your website, and host it on the raspberry pi refer this tutorial.
Step 4: Let Raspberry Pi Check My Email
connect the Mblink as shown in step 1. and find the address as shown in step 2...
go to /mail-checker folder in my git repo and open i2cLED.py
change the user name and password for your mail account and set the MAILSNOW to your current inbox unread mails number and MAILCHECK as the time duration for checking mails. (make sure you are connected to the internet)
run the code and you will see that the mail LED goes green when you have now new emails and RED when you GOT MAIL...