Skip to content

docs: add ASK-OOK repeater example - #52

Merged
mfurga merged 5 commits into
mainfrom
example/repeater
Aug 7, 2026
Merged

mfurga merged 5 commits into
mainfrom
example/repeater

Conversation

@mfurga

@mfurga mfurga commented Aug 7, 2026 •

Copy link
Copy Markdown
Owner

Adds an OOK signal repeater example.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread examples/Repeater/Repeater.ino Outdated
Comment thread examples/Repeater/Repeater.ino Outdated
Comment thread examples/Repeater/Repeater.ino
Comment thread examples/Repeater/Repeater.ino Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 sets firstLevel = 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 10 in the Radio constructor, whereas all other sketches define a CS_PIN macro 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);

@mfurga
mfurga merged commit 0a0c81b into main Aug 7, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants