Mock.GPIO icon indicating copy to clipboard operation
Mock.GPIO copied to clipboard

Trigger change in "edge" for specific chanel/pin

Open beachbumbob opened this issue 5 years ago • 4 comments

Is there a way to, for example, simulate that a hardware button is triggered? I.E. when a pin goes from HI to LOW or vice versa?

If not, consider this a start of a wish list.

Sincerely Max

beachbumbob avatar Dec 23 '20 18:12 beachbumbob

I created a very ugly solution, which is not 100% done and definitely not tested in any way except while debugging. If you want to use it, do so. My python skills are at best to classify as rudimentary, so if you choose to use my code, read thru it and test it before merge into master. https://github.com/beachbumbob/Mock.GPIO/tree/edge_control/Mock

beachbumbob avatar Jan 01 '21 16:01 beachbumbob

Thanks @beachbumbob for taking this up, will certainly have a look on this.

codenio avatar Jan 02 '21 06:01 codenio

Added some code. This code is only "tested/debugged" for python 2.7 Will keep working on it til it works for my current Pi scripts

beachbumbob avatar Jan 03 '21 20:01 beachbumbob

I've added so that output logs to a text file. This means that all my needs are satisfied at the moment. I will NOT add a pull request since the code is not ready for that. Feel free to use what ever parts you need if you want it.

beachbumbob avatar Jan 09 '21 19:01 beachbumbob