Add Local/Remote GPIO Support to PWM Button Control Tutorial #682
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.
Description
This PR adds Local and Remote GPIO operation modes to the "Modify PWM through button presses" Raspberry Pi tutorial, implementing support for the new remote GPIO functions introduced in splashkit-core PR #58.
Context: SplashKit now supports remote GPIO control, allowing developers to control Raspberry Pi GPIO pins from another computer over a network connection. This enables development and testing from a main development machine while controlling physical Pi hardware remotely, and supports controlling multiple Raspberry Pis simultaneously from a single program.
Related PR: thoth-tech/splashkit-core#58 - GPIO Remote Functions
Type of change
Changes Made
Tutorial Structure Updates
Added nested tab structure following the pattern used for C# language variants:
syncKey="code-language"for C++, C#, PythonsyncKey="gpio-mode"for Local and Remote operationsCode Examples Added
Main Code Block
Step-by-Step Sections
Documentation Added
remote_raspi_init()Explanation SectionComprehensive documentation covering:
name(string): Unique connection identifierip(string): Raspberry Pi IP addressport(integer): Daemon port (default 8888)Remote Function Pattern Documentation
remote_prefixconnectionobjectDaemon Setup Note
Added caution note linking to Remote Access Guide for daemon setup instructions.
How Has This Been Tested?
Code Validation
Documentation Review
connectiontype usageRemote Function Mapping
raspi_init()remote_raspi_init(name, ip, port)raspi_set_mode(pin, mode)remote_raspi_set_mode(conn, pin, mode)raspi_set_pwm_dutycycle(pin, duty)remote_raspi_set_pwm_dutycycle(conn, pin, duty)raspi_set_pull_up_down(pin, pud)remote_raspi_set_pull_up_down(conn, pin, pud)raspi_read(pin)remote_raspi_read(conn, pin)raspi_cleanup()remote_raspi_cleanup(conn)Testing Checklist
Checklist
If involving code
If modified config files
Folders and Files Added/Modified
Modified:
src/content/docs/guides/raspberry-gpio/3-pwm-button-control.mdxsyncKey="gpio-mode"nested tabs for Local/Remoteremote_raspi_init()parameter documentationNo Changes:
scripts/json-files/guides/Raspberry-GPIO/raspberry-gpio.json- Functions remain the samescripts/json-files/guides.json- Auto-generated, no manual changes neededCode Implementation Details
Local Version (Unchanged)
Remote Version (New)
Multi-Pi Example
Additional Notes
Why This Matters
Educational Value:
Practical Benefits:
Implementation Status
Completed:
remote_raspi_init()documentationIn Progress:
Future Work:
Dependencies
Required for Remote Operations:
pigpiodaemon running on target Raspberry PiDaemon Setup
Users must start the
pigpiodaemon on their Raspberry Pi:Detailed setup instructions linked at: https://programmers.guide/book/appendix/0-installation/4-0-remote-access-pi/
Breaking Changes
None. This is a pure addition of Remote GPIO examples alongside existing Local GPIO code. All existing Local code remains unchanged and fully functional.
Follow-up PRs
After this PR is merged, similar updates should be applied to:
Each tutorial will follow the same nested tab structure established here.
Preview
The tutorial now presents users with clear choices:
Main Code Block:
Step-by-Step Sections:
Each step maintains the same nested structure, allowing users to see exactly how each line differs between Local and Remote operations.