The ADC chip on the RPi Wobbulator uses the I2C protocol to communicate with the Raspberry Pi, but I2C is not enabled by default on the Raspberry Pi, so if you've not used an I2C device with your Raspberry Pi before then there are a few preparatory tasks you need to perform (this has been covered on a previous post, so if you've already done this you can skip this post and go straight to part 2).
Power up your Raspberry Pi, log in and then launch the LXDE desktop GUI. Open the file “/etc/modprobe.d/raspi-blacklist.conf” in Leafpad, go to the end of the file and "comment out" the last line by inserting a ‘#’ at the start of the line so that it looks like as shown below. Then save and close the file but please note that you will need root privileges to do so.
Open the file “/etc/modules” in Leafpad and add the line "i2c-dev" to the end of the file so that it looks like as shown below. Then save and close the file.
Now you need to install the “i2c-tools” package. Entering the following at the command prompt and press Enter:
pi@raspberrypi ~ $ sudo apt-get install i2c-tools_
Add your user name to the i2c group by entering the following at the command prompt (assuming your user name is “pi”) and pressing Enter:
pi@raspberrypi ~ $ sudo adduser pi i2c_
Now it's time to power down your Raspberry Pi and connect the Raspberry Pi Wobbulator. The complete assembly should now look like the following photo.
Power up your Raspberry Pi, log in and then launch the LXDE desktop GUI. Open an LXTerminal window and type the following at the command line prompt and press Enter:
pi@raspberrypi ~ $ i2cdetect -y 1_
This should detect the presence of the ADC chip on the RPi Wobulator and display the address of the i2c bus as shown below.
You now need to install the Quick2Wire library to allow easy access to the I2C port from Python 3, but first you need to download and install Setuptools.
Download the most up-to-date version of Setuptools (currently v1.1.6) from the Python website. Extract the “.tar.gz” package, go to the folder called “/setuptools-1.1.6” and enter the following at the command line prompt and press Enter:
.../setuptools-1.1.6 $ sudo python3 ez_setup.py_
Now download the Quick2Wire Python API package from GitHub. Extract the ".zip" file, go to the folder called “/quick2wire-python-api-master” and enter the following at the command line prompt and press Enter:
.../quick2wire-python-api-master $ sudo python3 setup.py install_
Now you should be ready to download and run the Raspberry Pi Wobbulator software. I'll explain how to do this and how to setup the hardware in my next post.