Skip to content

Latest commit

 

History

History
56 lines (39 loc) · 992 Bytes

README.md

File metadata and controls

56 lines (39 loc) · 992 Bytes

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

function:

  • GPIO.setmode(mode)
  • GPIO.setwarnings(flag)
  • GPIO.setup(channel, state, initial, pull_up_down)
  • GPIO.output(channel, outmode)
  • GPIO.input(channel)
  • GPIO.cleanup()

mode:

  • GPIO.BCP

state:

  • GPIO.OUT
  • GPIO.IN

initial, outmode:

  • GPIO.LOW
  • GPIO.HIGH

pull_up_down:

  • GPIO.PUD_OFF
  • GPIO.PUD_DOWN
  • GPIO.PUD_UP

Usage

See sample.py

Credit

This project based on Pi GPIO Emulator.