Raspberry Pi

Raspberry Pi Image Source: http://arstechnica.com/information-tech...

Que?

The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming.
http://www.raspberrypi.org/faqs

Specs

  • Broadcom BCM2835 SoC
    • CPU: 700 Mhz AMR11
    • GPU: OpenGL ES 2.0, 1080p H.264 encode/decode
  • 1 Composite Video, 1 HDMI
  • GPIO, SPI, I2C, I2S, UART
  • Size of a credit card!

Model A ($25)

  • 256 MiB RAM
  • 1 USB
  • No Networking

Model B ($35)

  • 512 MiB RAM
  • 2 USB, Integrated USB Hub
  • 10/100 Wired Ethernet

OS

Official from raspberrypi.org
  • Raspbian Wheezy: Debian optimized for Raspberry Pi raspbian.org
  • "Soft Float" raspbian wheezy available if you need want to run Java
  • Arch ARM, RISC OS
Unofficial

Getting Started

Buy

"Official" Distributors Other Options
  • Raspberry Pi
  • Power Supply: 5v 1A wall wort
  • USB A -> USB B Micro
  • SD Card: 4 Gb Class 4
  • SD Card Reader
  • Powered USB Hub (verified hubs)
  • USB WiFi (verified cards)
  • USB Keyboard & Mouse
  • RCA or HDMI Cable (HDMI -> DVI)
  • 3.5mm Audio -> RCA Adapter
  • IR Remote? Web Cam? Etc.
  • Breadboard, ICs, resistors, LEDs, wire, switches, sensors, etc

Install (Setup Guides)

wget http://downloads.raspberrypi.org/images/raspbian/2012-12-16-wheezy-raspbian/2012-12-16-wheezy-raspbian.zip
unzip ~/2012-12-16-wheezy-raspbian.zip
umount /dev/sdd1
dd bs=4M if=~/2012-12-16-wheezy-raspbian.img of=/dev/sdd
sudo sync

Configure

- First run of raspbian and raspbmc setup guides; Timezone (America/Chicago), locale (en_US.UTF-8), keyboard, resolution, overclock, etc

- /boot/config.txt (Docs)

- sudo raspi-config

Gotchas

  • No HDMI output: hdmi_safe=1
  • No WiFi
    1. Check hardware support
    2. Download drivers (links available at above link)
    3. Install and configure everything on CLI

Now What?

GPIO

GPIO Pin Layout
  • Up to 17 GPIO pins
  • 0 analog pins (no onboard ADC)
  • Control using Python, Bash,
    C, WebIOPi (others to come?)
Python
import RPi.GPIO as GPIO
GPIO.setup(7, GPIO.OUT)
GPIO.output(7, True)
GPIO.output(7,False)
Bash (everything is a file)
sudo su -
echo "4" > /sys/class/gpio/export
echo "4" > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio4/direction
echo "1" > /sys/class/gpio/gpio4/value
echo "0" > /sys/class/gpio/gpio4/value
echo "0" > /sys/class/gpio/export
echo "in" > /sys/class/gpio/gpio0/direction
cat /sys/class/gpio/gpio0/value
C (with wiringPi library)
#include <wiringPi.h>
#include <stdio.h>
 
int main (void)
{
  int pin = 7;
 
  if (wiringPiSetup() == -1)
    exit (1);
 
  pinMode(pin, OUTPUT);
 
  for (;;){
    printf("LED On\n");
    digitalWrite(pin, 1);
    delay(250);
    printf("LED Off\n");
    digitalWrite(pin, 0);
    delay(250);
  }
 
  return 0;
}

Demo

RaspBMC

XBMC Screenshot http://www.raspbmc.com

Demo

An award-winning [FOSS] (GPL) software media player and entertainment hub for digital media. It has been designed to be the perfect companion for your HTPC. Play popular audio and video formats, stream your multimedia from anywhere. Play CDs and DVDs from disk or image file. Scan your media and create a library with box covers, descriptions, and fanart. There are playlist and slideshow functions, a weather forecast feature and many audio visualizations.

Resources

Brandon Williams

@rocketeerbkw
rocketeerbkw@gmail.com
rocketeerbkw.com