JuReceiver/JuReceiver.ino

53 lines
1.3 KiB
Arduino
Raw Normal View History

2023-09-10 15:33:34 +02:00
// RC Config
#define myId 0x01
#define myChannel 1
#define jName "DefaultReceiver"
// activate System-Features
#define jMPU6050
#define jCOMP
#define jGNSS
#define debug true
// RC lib
#include "juRCReceiver.h"
2023-09-17 13:57:28 +02:00
TaskHandle_t RadioTaskHandle;
void RadioTask(void* parameter) {
for (;;) {
jRadioLoop();
if (rc_serial_available()) {
String got = rc_serial_read();
Serial.println("received serial: " + got);
rc_serial_write("got: " + got);
}
taskYIELD();
}
}
2023-09-10 15:33:34 +02:00
void onConnect() {}
void onDisconnect(bool expected) {}
void setup() {
// jSetOnConnect(onConnect);
// jSetOnDisconnect(onDisconnect);
Serial.begin(115200);
Serial.println("setup");
delay(1000);
jSetup();
2023-09-17 13:57:28 +02:00
xTaskCreatePinnedToCore(RadioTask, /* Function to implement the task */
"RadioTask", /* Name of the task */
10000, /* Stack size in words */
NULL, /* Task input parameter */
0, /* Priority of the task */
&RadioTaskHandle, /* Task handle. */
0); /* Core where the task should run */
2023-09-10 15:33:34 +02:00
}
void loop() {
jSensorLoop();
// fly
}