-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added examples * Changed metadata for arduino library manager
- Loading branch information
Showing
6 changed files
with
76 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
This will allow you to accs the Command Line Interpreter from the Serial | ||
Monitor, letteing you set up a radio and receive and transmit packets. | ||
*/ | ||
|
||
#include <OOKwiz.h> | ||
|
||
void setup() { | ||
Serial.begin(115200); | ||
OOKwiz::setup(); | ||
} | ||
|
||
void loop() { | ||
OOKwiz::loop(); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
Prints payload of a very specific type of packet, ignores all else. | ||
See README under "Meaning" | ||
*/ | ||
|
||
#include <OOKwiz.h> | ||
|
||
void setup() { | ||
Serial.begin(115200); | ||
OOKwiz::setup(); | ||
OOKwiz::onReceive(receive); | ||
} | ||
|
||
void loop() { | ||
OOKwiz::loop(); | ||
} | ||
|
||
void receive(RawTimings raw, Pulsetrain train, Meaning meaning) { | ||
if ( | ||
meaning.elements.size() != 2 || | ||
meaning.elements[0].type != PULSE || | ||
!tools::between(meaning.elements[0].time1, 5800, 6000) || | ||
meaning.elements[1].type != PWM || | ||
!tools::between(meaning.elements[1].time1, 175, 205) || | ||
!tools::between(meaning.elements[1].time2, 560, 590) || | ||
meaning.elements[1].data_len != 24 | ||
) { | ||
return; | ||
} | ||
// .data() on an std::vector gives a pointer to the first element | ||
uint8_t *data = meaning.elements[1].data.data(); | ||
Serial.printf("Data received 0:%02X 1:%02X 2:%02X", data[0], data[1], data[2]); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
Tranmits a specific type of packet. See README under "Meaning" | ||
*/ | ||
|
||
#include <OOKwiz.h> | ||
|
||
void setup() { | ||
Serial.begin(115200); | ||
if (OOKwiz::setup()) { | ||
Meaning newPacket; | ||
newPacket.addPulse(5900); | ||
uint8_t data[3] = {0x17, 0x72, 0xA4}; | ||
// 190 and 575 are space and mark timings, 24 is data length in bits | ||
newPacket.addPWM(190, 575, 24, data); | ||
newPacket.repeats = 6; | ||
newPacket.gap = 130; | ||
OOKwiz::transmit(newPacket); | ||
} | ||
} | ||
|
||
void loop() { | ||
OOKwiz::loop(); | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
name=OOKwiz | ||
version=0.1.3 | ||
version=0.1.4 | ||
author=Rop Gonggrijp | ||
maintainer=Rop Gonggrijp | ||
url=https://github.com/ropg/OOKwiz | ||
sentence=Receiving/analysing/sending on-off-keying signals for radio remote controls 📱, weather stations 🌦️ and more. | ||
paragraph=OOKwiz is an ESP32 Arduino library for receiving, analysing, decoding, encoding and transmitting On/Off keyed signals using a number of radios via RadioLib as well as a generic type. Radio plugins easy to build. Not just a library, also a versatile rx/tx OOK Swiss army knife. Used in a sketch that only calls the library's `setup()` and `loop()` functions, it prints output like below for received signals and provides a command line interpreter to set radio type, GPIO-pins used, etc. Settings are stored in flash on the ESP32 using SPIFFS. OOKwiz tries to read the data from messages, example: `pulse(5906) + pwm(timing 190/575, 24 bits 0x1772A4)` (all time in µs). That same format is among those accepted by the CLI `transmit` function, so on-the-fly experimentation is super-easy: just copy the string, change a few bits and transmit it back out. | ||
category=radio | ||
category=Signal Input/Output | ||
architectures=esp32 | ||
includes=OOKwiz.h | ||
depends=RadioLib |
This file contains 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