User Tools

Site Tools


user:ccornair:portfolio:datacomm1

Objectives

the purpose of this project is to turn an led on and off using a rapberry pie and the command line

Prerequisites

raspberry pie,monitor, keyboard, data cable, hdmi to usb cable, network cable

Background

The Raspberry Pi is a credit-card-sized single-board computer developed in the UK by the Raspberry Pi Foundation with the intention of promoting the teaching of basic computer science in schools.[7][8][9][10][11]

The Raspberry Pi is manufactured through licensed manufacturing deals with Newark element14 (Premier Farnell), RS Components and Egoman. All of these companies sell the Raspberry Pi online.[12] Egoman produces a version for distribution solely in China and Taiwan, which can be distinguished from other Pis by their red coloring and lack of FCC/CE marks. The hardware is the same across all manufacturers.

Code

Create a GPIO file access:
echo 11 > /sys/class/gpio/export 

Configure the Pin Direction (In/Out):
echo out > /sys/class/gpio/gpio11/direction

Write a value to turn on the LED using the GPIO11:
echo 1 > /sys/class/gpio/gpio11/value

Now your led should be ON!!!

Write a value to clear the LED using the GPIO11
echo 0 > /sys/class/gpio/gpio11/value

Now your led should be OFF!!!

Delete the created GPIO (11)
echo 11 > /sys/class/gpio/unexport

You are able to access to GPIO using python or any programming language. We wrote a python script to show how. Download

Open a new terminal and execute the script
wget https://sites.google.com/site/semilleroadt/raspberry-pi-tutorials/gpio/ADT_blink.py
python ADT_blink

References

user/ccornair/portfolio/datacomm1.txt · Last modified: 2013/12/13 03:28 by ccornair