From 5f0125da8b1e1551b2b0b7227c33af7963ba0cd1 Mon Sep 17 00:00:00 2001 From: Patrick Goebel Date: Mon, 7 Dec 2015 06:44:50 -0800 Subject: [PATCH] Fixed some indentation --- .../ROSArduinoBridge/ROSArduinoBridge.ino | 84 +++++++++---------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/ros_arduino_firmware/src/libraries/ROSArduinoBridge/ROSArduinoBridge.ino b/ros_arduino_firmware/src/libraries/ROSArduinoBridge/ROSArduinoBridge.ino index 5de3726..18bfc22 100644 --- a/ros_arduino_firmware/src/libraries/ROSArduinoBridge/ROSArduinoBridge.ino +++ b/ros_arduino_firmware/src/libraries/ROSArduinoBridge/ROSArduinoBridge.ino @@ -237,34 +237,34 @@ int runCommand() { void setup() { Serial.begin(BAUDRATE); -// Initialize the motor controller if used */ -#ifdef USE_BASE - #ifdef ARDUINO_ENC_COUNTER - //set as inputs - DDRD &= ~(1< nextPID) { - updatePID(); - nextPID += PID_INTERVAL; - } + // If we are using base control, run a PID calculation at the appropriate intervals + #ifdef USE_BASE + if (millis() > nextPID) { + updatePID(); + nextPID += PID_INTERVAL; + } - // Check to see if we have exceeded the auto-stop interval - if ((millis() - lastMotorCommand) > AUTO_STOP_INTERVAL) {; - setMotorSpeeds(0, 0); - moving = 0; - } -#endif + // Check to see if we have exceeded the auto-stop interval + if ((millis() - lastMotorCommand) > AUTO_STOP_INTERVAL) { + setMotorSpeeds(0, 0); + moving = 0; + } + #endif -// Sweep servos -#ifdef USE_SERVOS - int i; - for (i = 0; i < N_SERVOS; i++) { - servos[i].doSweep(); - } -#endif + // Sweep servos + #ifdef USE_SERVOS + int i; + for (i = 0; i < N_SERVOS; i++) { + servos[i].doSweep(); + } + #endif }