Help on package RPi.GPIO in RPi:
NAME RPi.GPIO - Copyright (c) 2012-2016 Ben Croston
FILE
/usr/lib/python2.7/dist-packages/RPi/GPIO/__init__.py
DESCRIPTION Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
PACKAGE CONTENTS
CLASSES
__builtin__.object
PWM
class PWM(__builtin__.object)
| Pulse Width Modulation class
|
| Methods defined here:
|
| ChangeDutyCycle(...)
| Change the duty cycle
| dutycycle - between 0.0 and 100.0
|
| ChangeFrequency(...)
| Change the frequency
| frequency - frequency in Hz (freq > 1.0)
|
| __init__(...)
| x.__init__(...) initializes x; see help(type(x)) for signature
|
| start(...)
| Start software PWM
| dutycycle - the duty cycle (0.0 to 100.0)
|
| stop(...)
| Stop software PWM
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __new__ = <built-in method __new__ of type object>
| T.__new__(S, ...) -> a new object with type S, a subtype of T
FUNCTIONS add_event_callback(...) Add a callback for an event already defined using add_event_detect() channel - either board pin number or BCM number depending on which mode is set. callback - a callback function
add_event_detect(...)
Enable edge detection events for a particular GPIO channel.
channel - either board pin number or BCM number depending on which mode is set.
edge - RISING, FALLING or BOTH
[callback] - A callback function for the event (optional)
[bouncetime] - Switch bounce timeout in ms for callback
cleanup(...)
Clean up by resetting all GPIO channels that have been used by this program to INPUT with no pullup/pulldown and no event detection
[channel] - individual channel or list/tuple of channels to clean up. Default - clean every channel that has been used.
event_detected(...)
Returns True if an edge has occured on a given GPIO. You need to enable edge detection using add_event_detect() first.
channel - either board pin number or BCM number depending on which mode is set.
getmode(...)
Get numbering mode used for channel numbers.
Returns BOARD, BCM or None
gpio_function(...)
Return the current GPIO function (IN, OUT, PWM, SERIAL, I2C, SPI)
channel - either board pin number or BCM number depending on which mode is set.
input(...)
Input from a GPIO channel. Returns HIGH=1=True or LOW=0=False
channel - either board pin number or BCM number depending on which mode is set.
output(...)
Output to a GPIO channel or list of channels
channel - either board pin number or BCM number depending on which mode is set.
value - 0/1 or False/True or LOW/HIGH
remove_event_detect(...)
Remove edge detection for a particular GPIO channel
channel - either board pin number or BCM number depending on which mode is set.
setmode(...)
Set up numbering mode to use for channels.
BOARD - Use Raspberry Pi board numbers
BCM - Use Broadcom GPIO 00..nn numbers
setup(...)
Set up a GPIO channel or list of channels with a direction and (optional) pull/up down control
channel - either board pin number or BCM number depending on which mode is set.
direction - IN or OUT
[pull_up_down] - PUD_OFF (default), PUD_UP or PUD_DOWN
[initial] - Initial value for an output channel
setwarnings(...)
Enable or disable warning messages
wait_for_edge(...)
Wait for an edge. Returns the channel number or None on timeout.
channel - either board pin number or BCM number depending on which mode is set.
edge - RISING, FALLING or BOTH
DATA
BCM = 11
BOARD = 10
BOTH = 33
FALLING = 32
HARD_PWM = 43
HIGH = 1
I2C = 42
IN = 1
LOW = 0
OUT = 0
PUD_DOWN = 21
PUD_OFF = 20
PUD_UP = 22
RISING = 31
RPI_INFO = {'MANUFACTURER': 'Embest', 'P1_REVISION': 3, 'PROCESSOR': '...
RPI_REVISION = 3
SERIAL = 40
SPI = 41
UNKNOWN = -1
VERSION = '0.6.3'