34 lines
747 B
C++
34 lines
747 B
C++
#include "FreeRTOSConfig.h"
|
|
#include "FreeRTOS.h"
|
|
#include <pico/stdlib.h>
|
|
#include <RadioLib/RadioLib.h>
|
|
#include <RadioLib/Module.h>
|
|
|
|
int main() {
|
|
// Currently written as numbered 1-40th pin on Pico
|
|
SX1262 radio = new Module(5, 26, 20, 4);
|
|
ConfigLoRa_t config;
|
|
config.frequency = 915;
|
|
int state = radio.begin(config);
|
|
if (state == RADIOLIB_ERR_NONE) {
|
|
printf("LoRa module initialized\n");
|
|
while(true) {
|
|
state = radio.startTransmit("Howdiddly doo");
|
|
if (state == RADIOLIB_ERR_NONE) {
|
|
printf("Transmitted properly!\n");
|
|
} else {
|
|
printf("Transmission failed\n");
|
|
}
|
|
sleep_ms(2000);
|
|
}
|
|
} else {
|
|
printf("Could not initialize LoRa module\n");
|
|
while(true) {
|
|
printf("Fuuuuuck\n");
|
|
sleep_ms(2000);
|
|
}
|
|
}
|
|
|
|
|
|
}
|