Updated on | #pi, #raspberry, #gpio

Raspberry PI

Here you can find Raspberry PI tutorials.

The GPIO connector actually has a number of different types of connection on them. There are:

  • True General Purpose Input Output (GPIO) pins that you can use to turn LEDs on and off etc.
  • I2C interface pins that allow you to connect hardware modules with just two control pins
  • SPI interface with SPI devices, a similar concept to I2C but a different standard
  • Serial Rx and Tx pins for communication with serial peripherals

As well as supplying power (GND, 3.3V and 5V) all the GPIO pins can be used as either digital inputs or outputs. In addition, some of the pins can be used for Pulse Width Modulation (PWM) for power control and another type of pulse generation for controlling servo motors called Pulse Position Modulation (PPM).

A good overview about the GPIO Header and Pins is illustrated in the following image for Raspberry2, which has the same layout at the A+ and B+:

Raspberry2 GPIO

WebIOPi for Raspberry Pi 2

  1. sudo -s
  2. cd /var/www
  3. wget http://sourceforge.net/projects/webiopi/files/WebIOPi-0.7.1.tar.gz
  4. tar xvzf WebIOPi-0.7.1.tar.gz
  5. cd WebIOPi-0.7.1
  6. wget https://raw.githubusercontent.com/doublebind/raspi/master/webiopi-pi2bplus.patch
  7. patch -p1 -i webiopi-pi2bplus.patch
  8. sudo ./setup.sh

R on Raspberry Pi

You should you the latest debian version called "jessie" for it. Hence, use this Raspberry Pi image for your memory stick.

Add Edit sources.list:

  1. sudo nano /etc/apt/sources.list
deb http://cran.r-project.org/bin/linux/debian jessie-cran3/
  1. apt-get update
  2. apt-get install r-base-core

After this you can update the packages with R:

  1. sudo R
update.packages(checkBuilt=TRUE, ask=FALSE)

GPG error

If you get the following error

W: GPG error: http://cran.r-project.org jessie-cran3/ Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 06F90DE5381BA480

you need to add the gpg key to apt.

  1. gpg --keyserver keyserver.ubuntu.com --recv 06F90DE5381BA480
  2. gpg --export --armor 06F90DE5381BA480  | sudo apt-key add -