Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/main.cpp
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,8 +9,10 @@ It will also read the speed of the motor and send it to the onboard computer.
#include <Adafruit_MCP4725.h>
#include "RefSpeed.h"
#include "BatteryFunctions.h"
#include "hardware/watchdog.h"
#include "globals.h"


#if defined(ROS) || defined(ROS_DEBUG)
#include <micro_ros_platformio.h>
#include "microRosFunctions.h"
Expand DownExpand Up@@ -108,7 +110,7 @@ void setup() {
pinMode(speedFreqLPin, INPUT_PULLDOWN);
attachInterrupt(digitalPinToInterrupt(speedFreqRPin), pulse_handler_1, RISING);
attachInterrupt(digitalPinToInterrupt(speedFreqLPin), pulse_handler_2, RISING);

watchdog_enable(3000, 1); // updating the watchdog// set the watchdog to run at 8s interval



Expand DownExpand Up@@ -143,7 +145,7 @@ void setup() {
}

void loop() {

watchdog_update(); //updating the watchdog
#if defined(ROS) || defined(ROS_DEBUG)
microRosTick();
refSpeedSensors = getRefSpeed();
Expand DownExpand Up@@ -238,4 +240,4 @@ void loop() {
#ifdef ROS_DEBUG
transmitDac(refSpeedL, refSpeedR);
#endif
}
}