Difference between revisions of "RPi Tutorial EGHS:Switch Input"

From eLinux.org
Jump to: navigation, search
(Created page with "{{Template:RPi Tutorials}} ''This page is part of a work in progress.''")
 
m
Line 4: Line 4:
  
 
''This page is part of a work in progress.''
 
''This page is part of a work in progress.''
 +
 +
==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 [[RPi Gertboard | Gertboard]]) is recommended which will help protect against damage.  Alternatively, experiment with one of the [[RPi Tutorial Easy GPIO Hardware & Software#Alternative Test Platforms | 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==
 +
 +
 +
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 [[RPi Tutorial Easy GPIO Hardware & Software#Alternative Test Platforms | Alternative Test Platforms]]
 +
for details) to test the hardware on (as it is cheap and the logic levels similar).
 +
 +
==The Hardware==
 +
===Theory===
 +
 +
===Circuit ===
 +
 +
==The Software==
 +
While the RPi is not available, I can only confirm the TI LaunchPad code works for me.
 +
===TI LaunchPad===
 +
The specifics and background behind the code is detailed very well on the following sites:
 +
 +
[http://processors.wiki.ti.com/index.php/MSP430_LaunchPad_PushButton MSP430 LaunchPad PushButton]
 +
 +
[http://processors.wiki.ti.com/index.php/MSP430_LaunchPad_Interrupt_vs_Polling MSP430 LaunchPad Interrupt vs Polling]
 +
 +
 +
Sample test code for switch input (tested on TI MSP430G2553 device).
 +
====Circuit ====
 +
 +
Code:
 +
 +
===RPi===
 +
 +
 +
==References==
 +
<references/>
 +
 +
{{Template:Raspberry Pi}}

Revision as of 12:00, 28 February 2012

Back to the Hub, or the Tutorials page.


GPIO Hardware & Software Tutorials:


This page is part of a work in progress.

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

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 (as it is cheap and the logic levels similar).

The Hardware

Theory

Circuit

The Software

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

TI LaunchPad

The specifics and background behind the code is detailed very well on the following sites:

MSP430 LaunchPad PushButton

MSP430 LaunchPad Interrupt vs Polling


Sample test code for switch input (tested on TI MSP430G2553 device).

Circuit

Code:

RPi

References