Short python program to change voltages in rpi gpio pins.

First I installed python:

sudo apt-get install python-pip

and then a library for gpio:

sudo pip install rpi.gpio

Once that was done, the following python script sets a high and low voltage to physical pin 11. Note: the physical pin 11 corresponds to GPIO 17.  The physical pin 6 corresponds to Ground.  For additional details and diagrams refer to:

import RPi.GPIO as GPIO
import time
for i in range(5):
   print ‘——————‘
   print ‘now in repetition:’,i
   print ‘ON…’
   print ‘OFF…’

To run the program above, I created a script and ran it as shown below:

sudo python

Note: additional information for the rpi unit:

linux distribution: ID=debian

user: pi

password: raspberry

 available from: MCM electronics:

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: