GithubHelp home page GithubHelp logo

raspberry-gpio-emulator's People

Contributors

gitze avatar nosix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

raspberry-gpio-emulator's Issues

Pin mapping

Hi!
It seems to make the code running on Raspberry 3 B+ you should use GPIO.setmode(GPIO.BOARD) instead of GPIO.BCM. Pin 12 board pinout supports PWM.

Stop emulator from application

Many thanks for the development of the project. It helps a lot if you don't have to work on the Pi all the time.

But is there a clean way, to stop the emulator and close the gui from the application and not per clicking the gui?
At this moment I have to interrupt the emulator per SIGINT or Keyboard Interrupt what leads to an error message.

能否增加python2.7的支持?

import RPi.GPIO
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/site-packages/RPi/GPIO.py", line 5, in
from .launcher import ui
File "/usr/local/lib/python2.7/site-packages/RPi/launcher.py", line 3, in
from .pipe import Pipe
File "/usr/local/lib/python2.7/site-packages/RPi/pipe.py", line 1, in
from builtins import bytes
ImportError: No module named builtins

========================================
使用pip install future
添加builtins的支持后

显示如下错误:
Python 2.7.13 (default, Dec 18 2016, 07:03:39)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

import RPi.GPIO
Traceback (most recent call last):
File "", line 1, in
RuntimeError: not holding the import lock
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py", line 1542, in call
return self.func(*args)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py", line 592, in callit
func(*args)
File "/usr/local/lib/python2.7/site-packages/RPi/ui_server.py", line 90, in __update
raise ex
IOError: [Errno 35] Resource temporarily unavailable

Cannot change pin mode after initial setup

Hello nosix,
thanks for sharing this useful GPIO simulation library!
In my program I want to first setup a pin as input (High-Z), and after a game is completed set it to output LOW. This works fine with the real RPi GPIO library. But with the emulator library, this error is thrown:

Traceback (most recent call last):
  File "./riddle_beer_dispenser.py", line 105, in <module>
    main()
  File "./riddle_beer_dispenser.py", line 92, in main
    GPIO.setup(solvedPin, GPIO.OUT, initial=GPIO.LOW)
  File "/home/dan/.local/lib/python3.8/site-packages/RPi/GPIO.py", line 159, in setup
    __setup(__to_channel(channel), state, initial, pull_up_down)
  File "/home/dan/.local/lib/python3.8/site-packages/RPi/GPIO.py", line 168, in __setup
    assert channel not in __pins_dict, 'GPIO is already setup'
AssertionError: GPIO is already setup

I think it should be possible to change the pin mode once more after initial setup. Can you please fix it?

callback pin/channel compatibility

Hi!

I am using the GPIO.add_event_detect with GPIO.BOARD setting.

The emulator in the callback gives the channel number instead of the pin number.

The documentation sais it is OK, but on the hardware the default GPIO library gives the pin number in this case!

The old code:
GPIO.add_event_detect(PINS.BUTTON, GPIO.BOTH, callback=waitOnEvent)
which gives the parameter like channel.

I use the folowing workaround:
GPIO.add_event_detect(PINS.BUTTON, GPIO.BOTH, callback=lambda x: waitOnEvent(PINS.BUTTON))
which gives the parameter like pin (PINS.BUTTON)

I dont know it is a problem or not, but definitely a compatible issue...

Regards, Art

pip install

Hello, Great job !
Can we expect one day the package will be available on pypi.org?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.