Skip to content

nosix/raspberry-gpio-emulator

Repository files navigation

raspberry-gpio-emulator

RPi.GPIO emulator

Require

  • Python 3.5

Install

$ pip install git+https://github.com/nosix/raspberry-gpio-emulator/

API

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 : GPIO.LOW or GPIO.HIGH (option)
    • pull_up_down : GPIO.PUD_OFF, GPIO.PUD_DOWN or GPIO.PUD_UP (option)
  • GPIO.output(channel, outmode)
    • channel : int or Sequence[int]
    • outmode : GPIO.LOW, GPIO.HIGH or Sequence[GPIO.LOW or GPIO.HIGH]
  • GPIO.input(channel)
    • channel : int
  • GPIO.cleanup(channel)
    • channel : int or Sequence[int] (option)

Usage

Documentation of raspberry-gpio-python:

Sample code:

Credit

This project based on Pi GPIO Emulator.