From a518d028652c41e910eee7c17b1fb82792fee84a Mon Sep 17 00:00:00 2001 From: woozydragon Date: Tue, 24 Oct 2023 21:15:18 -0400 Subject: [PATCH] added uwb_timer --- lunabot_embedded/firmware/teensy_main/teensy_main.ino | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lunabot_embedded/firmware/teensy_main/teensy_main.ino b/lunabot_embedded/firmware/teensy_main/teensy_main.ino index 8f5a2428..832e8cea 100644 --- a/lunabot_embedded/firmware/teensy_main/teensy_main.ino +++ b/lunabot_embedded/firmware/teensy_main/teensy_main.ino @@ -5,9 +5,10 @@ #include #include -#define TX_PERIOD 10 // ms -#define ENC_TRANSFER_PERIOD 1000 // microsec -#define CURR_UPDATE_PERIOD 8 // ms +#define TX_PERIOD 10 // ms +#define ENC_TRANSFER_PERIOD 1000 // microsec +#define UWB_TRANSFER_PERIOD 10'000 // microsec +#define CURR_UPDATE_PERIOD 8 // ms RobotState state = RobotState_init_zero; RobotEffort effort = RobotEffort_init_zero; @@ -49,6 +50,7 @@ void send() { pb_encode(&stream, RobotState_fields, &state); } IntervalTimer enc_timer; +IntervalTimer uwb_timer; void setup() { STMotorInterface::init_serial(ST_SERIAL, ST_BAUD_RATE); @@ -56,6 +58,7 @@ void setup() { EncoderBus::init(); enc_timer.begin(EncoderBus::transfer, ENC_TRANSFER_PERIOD); + uwb_timer.begin(UWBBus::transfer, UWB_TRANSFER_PERIOD); // disable timeout MC1.setTimeout(0);