Building dummy package using pyCharm

Viewed 61

I am writing a GUI for my Raspberry pi, but I'd like to work on the code on PC, then drop it into the pi, just cos the tools are better and I mostly have remote access to the pi etc etc. My problem is that the GUI does some calls to change IO pins on the Pi, using the RPi.GPIO library, which doesn't exist on PC. Of course I can comment out the lines of pi-specific code, but that's really messy especially if I start going back and forth. My idea is to set up a dummy/mirror library for the PC, then the code picks the dummy library on PC and the real library on the pi. Seems simple, but I'm getting really bogged down creating my own library. So, to my question, in summary - what is the easiest way to create a quick library using PyCharm that my code would pick up...

Here is some quick code for context...

import RPi.GPIO as GPIO # this is the library I want to mirror

# sets pin numbering on pi, does completely nothing in 
#  the dummy I want to call in on on PC
GPIO.setmode(GPIO.BOARD) 
GPIO.output(self.reset_pin, 1) # also does stuff on pi, nothing on PC
1 Answers

There is the fake-rpi package on pypi:

So, does this simulate everything on a Raspberry Pi? No! Right now it simulates what I use and need. Over time, more will be added. You are also welcome to submit pull requests for things I haven't added yet.

But it looks like it simulates GPIO pins

Related