Add unified ESP32 BLE sketch combining closed-loop steering actuator control and ESC throttle output#1
Open
Copilot wants to merge 3 commits into
Open
Add unified ESP32 BLE sketch combining closed-loop steering actuator control and ESC throttle output#1Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
Agent-Logs-Url: https://github.com/uscmakers/SkateMo/sessions/1ab7fa0a-dd82-4346-afcf-1e686e1c6bbe Co-authored-by: ycjohnp <198846355+ycjohnp@users.noreply.github.com>
Agent-Logs-Url: https://github.com/uscmakers/SkateMo/sessions/1ab7fa0a-dd82-4346-afcf-1e686e1c6bbe Co-authored-by: ycjohnp <198846355+ycjohnp@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Combine BLE command logic and ESC control for ESP32
Add unified ESP32 BLE sketch combining closed-loop steering actuator control and ESC throttle output
Apr 17, 2026
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.
This PR adds a single ESP32 Arduino sketch that merges BLE-driven steering actuator control (with potentiometer feedback) and brushless truck ESC control via servo-style PWM. It preserves the existing BLE command protocol/UUIDs while adding ESC arming and fail-safe throttle behavior.
New unified sketch
BLEActuatorEscUnified/BLEActuatorEscUnified.ino.BLEMotorCombinedLEFT/RIGHT/FWD/BACK/STOP) with target-based actuator controlESP32Servo+writeMicroseconds()BLE protocol compatibility
SERVICE_UUID = 12345678-1234-1234-1234-123456789012CHARACTERISTIC_UUID = 87654321-4321-4321-4321-2109876543210x80 | cmd.ESC integration + safety
1000–2000us) instead of legacy2800usmax.FWD: ramp to capped forward throttle and holdBACK/STOP: ramp down to minimum throttleESP32 PWM handling
ledcAttach/ledcWrite) for explicit ESP32-compatible PWM control.Documentation
README.mdwith a brief section describing the new unified sketch and default ESC pin.Original prompt
Create a single unified Arduino sketch for ESP32 that combines:
BLEMotorCombined/BLEMotorCombined.inoonmain.trucks_motor_control.cppon branchfeature/trucks-motor-control.Repository: uscmakers/SkateMo
Base branch: main
Constraints / requirements:
BLEMotorCombined.ino.writeMicroseconds.analogWriteif necessary; prefer LEDC PWM for H-bridge enable pin if needed. If keepinganalogWrite, ensure it is supported in the ESP32 Arduino core; otherwise implement LEDC setup.Deliverables:
BLEActuatorEscUnifiedwith fileBLEActuatorEscUnified.inocontaining the combined code.Acceptance criteria:
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: In this current repo and the current branch. Is there a unfied code the combines the linear actuator control with the code that writes waveforms (using the servo library) to control an ESC (electronic speed controller) to power a brushless motor?
Assistant: I can’t verify that from here yet, because I don’t currently have access to
uscmakers/SkateMovia the code-search tools (“repo inaccessible or not found”).If you do have access and can share either:
.inofiles), orthen I can answer precisely whether there’s a single unified sketch/module that combines:
Servo.h,attach(),writeMicroseconds(), arming sequence).What I’ll check once I can access the code:
Servo.hand also containing actuator-related pins/logic in the same file.actuator_control.inoandesc_test.ino) that are not actually unified.Reply with the repo link (or make it public temporarily), and tell me the default branch (e.g.,
main), and I’ll locate the exact file(s) and point you to them.User: @uscmakers/SkateMo
Assistant: No — in the
uscmakers/SkateMorepo on themainbranch (at least in the code currently present in the directories we inspected), there isn’t a single unified sketch that combines linear actuator control and ESC control via Servo-library waveform output.What is present are separate sketches for different subsystems:
Linear actuator / steering-style closed-loop control (pot feedback + H-bridge PWM):
BLEMotorCombined/BLEMotorCombined.inoThis reads a potentiometer (
analogRead) and drives a motor through an H-bridge usingdigitalWrite+analogWritebased on BLE commands. It does not include Servo/ESC waveform generation.Linear actuator basic serial “up/down” control:
`MakersActuator/MakersA...
This pull request was created from Copilot chat.