mirror of
https://github.com/YikeStone/ros_arduino_bridge.git
synced 2025-08-04 11:44:08 +05:30
Fixed some indentation
This commit is contained in:
parent
f37836d4e0
commit
5f0125da8b
@ -237,8 +237,8 @@ int runCommand() {
|
||||
void setup() {
|
||||
Serial.begin(BAUDRATE);
|
||||
|
||||
// Initialize the motor controller if used */
|
||||
#ifdef USE_BASE
|
||||
// Initialize the motor controller if used */
|
||||
#ifdef USE_BASE
|
||||
#ifdef ARDUINO_ENC_COUNTER
|
||||
//set as inputs
|
||||
DDRD &= ~(1<<LEFT_ENC_PIN_A);
|
||||
@ -246,25 +246,25 @@ void setup() {
|
||||
DDRC &= ~(1<<RIGHT_ENC_PIN_A);
|
||||
DDRC &= ~(1<<RIGHT_ENC_PIN_B);
|
||||
|
||||
//enable pull up resistors
|
||||
// Enable pull up resistors
|
||||
PORTD |= (1<<LEFT_ENC_PIN_A);
|
||||
PORTD |= (1<<LEFT_ENC_PIN_B);
|
||||
PORTC |= (1<<RIGHT_ENC_PIN_A);
|
||||
PORTC |= (1<<RIGHT_ENC_PIN_B);
|
||||
|
||||
// tell pin change mask to listen to left encoder pins
|
||||
// Tell pin change mask to listen to left encoder pins
|
||||
PCMSK2 |= (1 << LEFT_ENC_PIN_A)|(1 << LEFT_ENC_PIN_B);
|
||||
// tell pin change mask to listen to right encoder pins
|
||||
// Tell pin change mask to listen to right encoder pins
|
||||
PCMSK1 |= (1 << RIGHT_ENC_PIN_A)|(1 << RIGHT_ENC_PIN_B);
|
||||
|
||||
// enable PCINT1 and PCINT2 interrupt in the general interrupt mask
|
||||
// Enable PCINT1 and PCINT2 interrupt in the general interrupt mask
|
||||
PCICR |= (1 << PCIE1) | (1 << PCIE2);
|
||||
#endif
|
||||
initMotorController();
|
||||
resetPID();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Attach servos if used */
|
||||
/* Attach servos if used */
|
||||
#ifdef USE_SERVOS
|
||||
int i;
|
||||
for (i = 0; i < N_SERVOS; i++) {
|
||||
@ -321,26 +321,26 @@ void loop() {
|
||||
}
|
||||
}
|
||||
|
||||
// If we are using base control, run a PID calculation at the appropriate intervals
|
||||
#ifdef USE_BASE
|
||||
// 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) {;
|
||||
if ((millis() - lastMotorCommand) > AUTO_STOP_INTERVAL) {
|
||||
setMotorSpeeds(0, 0);
|
||||
moving = 0;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Sweep servos
|
||||
#ifdef USE_SERVOS
|
||||
// Sweep servos
|
||||
#ifdef USE_SERVOS
|
||||
int i;
|
||||
for (i = 0; i < N_SERVOS; i++) {
|
||||
servos[i].doSweep();
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user