Skip to Content

Arduino Compiling error

Posted in

Hi gang.

I'm getting an error when I try to compile the OpenMoco code in Arduino.

o: In function `__vector_4':
C:\Users\(username)\AppData\Local\Temp\build9218211377612668356.tmp/OpenMoco_Timelapse_Engine.cpp:570: multiple definition of `__vector_4'

C:\Users\(username)\AppData\Local\Temp\build9218211377612668356.tmp\NewSoftSerial\NewSoftSerial.cpp.o:C:\Users\ehanson\Desktop\arduino-0018\arduino-0018\libraries\NewSoftSerial/NewSoftSerial.cpp:323: first defined here

Any ideas, I have not been looking at this for very long but I just figured out I might as well post this here if there is an easy solution.

What version of NewSoftSerial

What version of NewSoftSerial are you using? Version 7 required commenting out parts of NewSoftSerial.cpp (as indicated in the install notes at the bottom of the code download page), whereas version 10 seems to use a more dynamic method of creating its interrupts.

If you let me know which version of NewSoftSerial you're using, I can get you past this step. =)

!c

Great response time. I

Great response time.

I downloaded the NewSoftSerial10c

Ok, for the time being, the

Ok, for the time being, the easiest way to get moving, if you don't need the ALT IN capabilities right away is to comment out the interrupt handlers for the alt input. I'll contact Mikal soon and see if there's a good way to subvert his new interrupt registration in versions later than 7.

Here's the code you'll want to comment out, in the file OM_Alt_Control.pde, starting at line 114, change it to look like this:

// define our signal handler:

/*
SIGNAL (PCINT1_vect) {

   // signal handler for alt input
   // set a flag so the next loop will
   // catch it.
 
  if( digitalRead(ALT_PIN) == HIGH ) {
    if( alt_pin_state == LOW ) {
        alt_trigger   = true;
        alt_pin_state = HIGH;
    }
  }
  else {
    alt_pin_state = LOW;
  }
 
}  
*/

void alt_enable_input(boolean on) {
/*

    // disable interrupts  
  cli();
 
    // turn on or off interupt handler
  if( on ) {
   
    PCMSK1 |= (1<<PCINT13); //  tell pin change mask to listen to pin13 (analog 5)
    PCICR  |= (1<<PCIE1); // enable PCINT interrupt
   
  }
  else {
    PCMSK1 |= (0<<PCINT13); //  tell pin change mask to not listen to pin13 (analog5)
    PCICR  |= (0<<PCIE1); // disable PCINT interrupt
   

  }

    // enable interrupts
  sei();
 
*/

}

That is, comment out completely the signal handler definition, and then comment out the contents of the alt_enable_input() function, but leave the definition in place.

!c