Difference between revisions of "RPi Tutorial EGHS:LED output"

From eLinux.org
Jump to: navigation, search
m (Aims)
m
Line 8: Line 8:
 
==Aims==
 
==Aims==
 
The purpose of this guide is to enable control of an LED via the GPIO pins of the RPi.
 
The purpose of this guide is to enable control of an LED via the GPIO pins of the RPi.
 +
 +
This is the embedded version of writing a program to display "Hello World" and is the first step in getting started.
  
 
The first stage will be to build the hardware we are going to use, and then we shall look at the software which will drive it.
 
The first stage will be to build the hardware we are going to use, and then we shall look at the software which will drive it.
Line 17: Line 19:
  
  
 +
==The Hardware==
 +
===Theory===
 +
This is only a brief and rough overview, since the basics are covered in a lot more detail in many other places (see below).
 +
 +
The GPIO pins on the RPi when defined as an '''Output''' is able to cause the voltage on the pin to go '''HIGH (source)''' or '''LOW (sink)'''.  This allows signals to be sent to other processors and devices like LEDs.  However it is important to remember that the pin will only be able to Source or Sink very small currents, so higher powered devices (such as motors) can not be driven directly from a GPIO pin.
 +
 +
''For additional detail see [[http://www.scriptoriumdesigns.com/embedded/gpio_out.php | Introduction To Embedded Programming - GPIO Output]]''
 +
 +
===Circuit 1===
 +
 +
 +
==The Software==
 +
While the RPi is not available, I can only confirm the TI LaunchPad code works for me.
 +
===TI LaunchPad===
 +
 +
===RPi===
  
  

Revision as of 02:17, 1 February 2012

Back to the Hub.


Community Pages:

Tutorials - a list of tutorials. Learn by doing.

Guides - a list of informative guides. Make something useful.

Projects - a list of community projects. Help others out.

Tasks - for advanced users to collaborate on software tasks.

Datasheets - a frambozenier.org documentation project.

Education - a place to share your group's project and find useful learning sites.

Community - links to the community elsewhere on the web.

Games - all kinds of computer games.

Warnings

While most of these circuits may interface directly to the RPi, the use of a buffered interface (such as the one supplied by the Gertboard) is recommended which will help protect against damage. Alternatively, experiment with one of the Alternative Test Platforms.


Extreme caution should be exercised when interfacing hardware at a low level, you may damage your RPi, your equipment and potentially yourself and others. Doing so is at your own risk!

Aims

The purpose of this guide is to enable control of an LED via the GPIO pins of the RPi.

This is the embedded version of writing a program to display "Hello World" and is the first step in getting started.

The first stage will be to build the hardware we are going to use, and then we shall look at the software which will drive it.

Note:
Until RPi devices are available, I can not confirm this will work on a real RPi.
For now, I shall be using the TI LaunchPad (see  Alternative Test Platforms
for details) to test the hardware on.


The Hardware

Theory

This is only a brief and rough overview, since the basics are covered in a lot more detail in many other places (see below).

The GPIO pins on the RPi when defined as an Output is able to cause the voltage on the pin to go HIGH (source) or LOW (sink). This allows signals to be sent to other processors and devices like LEDs. However it is important to remember that the pin will only be able to Source or Sink very small currents, so higher powered devices (such as motors) can not be driven directly from a GPIO pin.

For additional detail see [| Introduction To Embedded Programming - GPIO Output]

Circuit 1

The Software

While the RPi is not available, I can only confirm the TI LaunchPad code works for me.

TI LaunchPad

RPi

<references>