Enabling The SPI Port
You now use the raspbian config tool:
Select 'Advanced Options' and then select the relevant option.
Enabling The SPI Port On Old Raspbian Distributions
The SPI port needs to be enabled in Raspbian before it can be used.
Edit the modules blacklist file:
sudo nano /etc/modprobe.d/raspi-blacklist.conf
Add a '#' character to this line so it is commented out:
Exit and save the file.
Enter "sudo reboot" to restart the pi and now the SPI pins will be available to use.
Test the SPI Port
Test the SPI port is working by typing:
You should see the following:
There are 2 spidev devices shown. The first number refers to the SPI peripheral which in both cases is 0 (the RPi only has 1 SPI port), the second number represents the chip select pins CS0 and CS1 .