Repository navigation
docs: add ASK-OOK repeater example - #52
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new Arduino example demonstrating how to capture and replay (repeat) arbitrary 433 MHz ASK/OOK bursts using the CC1101 library’s asynchronous serial mode, without decoding the protocol.
Changes:
- Introduces a pulse-timing capture buffer and replay routine to retransmit an observed OOK burst.
- Configures CC1101 for ASK/OOK + async serial mode and provides a simple Serial log flow.
Suppressed comments (1)
examples/Repeater/Repeater.ino:73
- The edge-wait loop during capture doesn’t yield while waiting for the next transition (it only checks the GAP_US timeout). Adding yield() here avoids long busy spins when the signal is absent or the line is stuck at a level.
while (pulseCount < MAX_PULSES) {
while (digitalRead(GDO0_PIN) == level) {
if (micros() - edge > GAP_US) {
return pulseCount >= MIN_PULSES;
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (2)
examples/Repeater/Repeater.ino:6
- The header comment describes this as a “Universal” repeater, but the capture logic explicitly requires the burst to start with a HIGH pulse of at least
PULSE_MIN_US(and setsfirstLevel = HIGH). That constraint should be called out (or the code generalized), otherwise the description is misleading for signals that begin with a LOW segment.
// Universal OOK signal repeater using asynchronous serial mode.
//
// This listens for a 433 MHz OOK burst, records it, and re-transmits an identical
// copy. It works WITHOUT knowing the data rate, bit encoding or framing, because
// it never decodes anything. We simply time the high/low pulse widths on capture
examples/Repeater/Repeater.ino:15
- This example hardcodes the CS pin as
10in theRadioconstructor, whereas all other sketches define aCS_PINmacro and use it in the constructor (e.g.examples/AsyncSerial/Transmit/Transmit.ino). Keeping the same pattern makes it easier to adjust wiring consistently across examples.
#define GDO0_PIN 15
Radio radio(/* cs */ 10, /* gd0 */ GDO0_PIN);
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.
Adds an OOK signal repeater example.