adafruit / TinyLoRa

LoRaWAN Library
69 stars 38 forks source link

Make frequency selection work at runtime, by providing a setRegion method #35

Open Jon-Bright opened 4 years ago

Jon-Bright commented 4 years ago

This increases the size of the compiled sketch by 160 bytes, but that seems like a reasonable price to pay for runtime configuration of the region. The previous method, #define-ing a frequency in the sketch, has no effect because that same #define is not present when the library is compiled.

This option is my preferred option to fix this, in contrast with the PR just sent.

This option maintains compatibility with all code that currently works by keeping the default as US902.

Jon-Bright commented 4 years ago

Here's the other, less-preferred option

brentru commented 4 years ago

@Jon-Bright Could you please add to the example, showing how to use this PR?