Hardware Reference
In-Depth Information
Enter # at the start of the line blacklist spi-bcm2708 like so:
#blacklist spi-bcm2708
Save the ile. If using the nano editor, press Ctrl + X and then conirm that you want to save
the ile before exiting.
Commenting out is a way of making the computer ignore what is on that line. It works by
turning the line into a comment. Comments are text intended for the user and not interpreted
by the computer.
It is better to comment a line out rather than delete it as it makes it easier to restore later by
uncommenting (that is, removing the comment marker). Python also uses # for comments, so
you can temporarily remove a line of code by putting a # at the start of the line.
Restart the Raspberry Pi by typing sudo reboot .
After reboot log in and type lsmod again, and you should see spi_bcm2708 listed. Programs
send a message over the SPI bus by writing characters to a special ile. Type ls -la /dev/
spi* to check whether the special ile exists. If you're successful, Linux will show at least one
ile. If you receive a message such as No such file or directory , you need to check
that the SPI driver module is functioning correctly.
Installing Python Modules
With the spi_bcm2708 module loaded, Linux can talk SPI to peripherals. he next step is to
install programs that will make the driver easier to use and send the correct messages over the
SPI bus to control the hardware:
1. Make sure that the Raspberry Pi is up to date. Because the Raspberry Pi will check the
Internet for updates, you need to make sure that your Raspberry Pi is online. hen
type sudo apt-get update .
Wait until Linux downloads and updates iles, which can typically take a couple of minutes.
2. Install the necessary packages by typing sudo apt-get install python-dev
python-gtk2-dev git .
Linux will list any other programs necessary and tell you how much additional disk
space is required. Conirm that you want to continue by typing Y and pressing enter.
After a few minutes the programs will be installed.
 
Search WWH ::




Custom Search