RPi.GPIO emulator
- Python 3.5
$ pip install git+https://github.com/nosix/raspberry-gpio-emulator/
import RPi.GPIO as GPIO
- GPIO.setmode(mode)
- mode : GPIO.BOARD or GPIO.BCP
- GPIO.setwarnings(flag)
- flag : bool
- GPIO.setup(channel, state, initial, pull_up_down)
- channel : int or Sequence[int]
- state : GPIO.OUT or GPIO.IN
- initial (option) : GPIO.LOW or GPIO.HIGH
- pull_up_down (option) : GPIO.PUD_OFF, GPIO.PUD_DOWN or GPIO.PUD_UP
- GPIO.output(channel, outmode)
- channel : int or Sequence[int]
- outmode : GPIO.LOW, GPIO.HIGH or Sequence[GPIO.LOW or GPIO.HIGH]
- GPIO.input(channel) : bool
- channel : int
- GPIO.cleanup(channel)
- channel (option) : int or Sequence[int]
- GPIO.wait_for_edge(channel, event, timeout) : int or None
- channel : int
- event : GPIO.RISING, GPIO.FALLING or GPIO.BOTH
- timeout (option) : int
- GPIO.add_event_detect(channel, event, callback, bouncetime)
- channel : int
- event : GPIO.RISING, GPIO.FALLING or GPIO.BOTH
- callback (option) : function(channel)
- channel : int
- bouncetime (option) : int
- GPIO.add_event_callback(channel, callback, bouncetime)
- channel : int
- callback : function(channel)
- channel : int
- bouncetime (option) : int
- GPIO.remove_event_detect(channel)
- channel : int
- GPIO.event_detected(channel) : bool
- channel : int
- GPIO.gpio_function(channel) : GPIO.OUT, GPIO.IN, GPIO.SERIAL, GPIO.SPI, GPIO.I2C or GPIO.HARD_PWM
- channel : int
Documentation of raspberry-gpio-python:
Sample code:
This project based on Pi GPIO Emulator.
- Roderick Vella
- 2016
- Pi GPIO Emulator
- This project uses base design as reference, but it changes usage and implementation.