Open
Conversation
Simulate press a button
Simulate press a button
Simulate press a button
Author
|
If you like it, go ahead and merge. If think it is rubbish, delete it, you wont hurt my feelings. |
Contributor
|
Please rebase this pull request.
|
cclauss
reviewed
Sep 29, 2025
| """ | ||
| Mock Library for RPi.GPIO | ||
| """ | ||
| #Mock Library for RPi.GPIO |
Contributor
There was a problem hiding this comment.
Please revert. Docstrings will go into any automated documentation while comments will not.
cclauss
reviewed
Sep 29, 2025
| class Channel: | ||
| def __init__(self,channel, direction, initial=0,pull_up_down=PUD_OFF): | ||
| self.channel = channel | ||
| self.chanel = channel |
cclauss
reviewed
Sep 29, 2025
| IN = 1 | ||
| LOW = 0 | ||
| OUT = 0 | ||
| INPUT = 1 |
Contributor
There was a problem hiding this comment.
input is a Python builtin, and we already have IN, so perhaps make this BUTTON_PRESSED or something else to make its use clearer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Simulate input
This make it possible to simulate input to a GPIO pin, e.g. pressing a button.
echo "[PINNUMBER]:[HI|LOW]" > /dev/tcp/{host}/{port}
The port is hardcoded to 5566
example:
echo "18:LOW" > /dev/tcp/192.168.122.143/5566
For this to work you have to have python script that activate the GPIO, e.g GPIO.add_event_detect({pinnumber}, GPIO.FALLING, handle, bouncetime=1500)