View on GitHub

Introduction to Raspberry Pi

Artisan's Asylum

Module 2 - Internet enabling the Pi, General Purpose Inputs and Outputs

Our second module will jump into the use of the Flask webserver and the Raspberry Pi's input/output ports. Flask will let us control our Raspberry Pi from any smartphone, tablet or laptop. Then we'll learn about how to use the Raspberry Pi to control actuators or light up LEDs. We'll also discover how to read digital inputs like switches and sensors.

Class Resources


  • To retrieve a personal copy of the source code for the class, you may use either the Adafruit WebIDE or the git command line client. You are welcome to fork, modify, improve and contribute your changes back. Help make the class better for everyone.

  • Adafruit WebIDE: Click the "Clone Repository" button and enter the repository url:

  • Command Line: Run git clone

  • To use the interrupt features of the RPi-GPIO library, you may need to upgrade to the latest version. You can check which version you have by running the following command:

python -c "import RPi.GPIO; print RPi.GPIO.VERSION"

You should see the value "0.5.11" printed out. If the version is lower than 0.5.11, run these commands on your Raspberry Pi to upgrade to the latest version.

  sudo apt-get install python-pip
  sudo pip uninstall RPi.GPIO
  sudo dpkg -i python-rpi.gpio_0.5.11_armhf.deb

Extra Projects

References and Additional Material