Announcement

Collapse
No announcement yet.

Error Compiling with 3rd Party Libraries

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error Compiling with 3rd Party Libraries

    I am trying to include a couple of libraries in my project. It all compiles fine if I select an Uno. But, when I select the 4Duino, I get multiple compile errors. I thought that the 4Duino was compatible with the all Uno libraries, but obviously I'm not understanding something here.

    These are the libraries I've included

    #include <ClearPathMotorSD.h>
    #include <ClearPathStepGen.h>
    #include <Conceptinetics.h>

    Here is a full list of the error messages. In order to get the full list I had to comment out one of the includes at a time.

    I'm really not sure how to include these in my project without causing errors. Any help is greatly appreciated.

    This is the error list if I only include the Conceptinetics file

    Arduino: 1.8.5 (Mac OS X), Board: "4Duino - 2.4""

    /Users/PD/Documents/Arduino/libraries/Conceptinetics/Conceptinetics.cpp: In member function 'void DMX_Master::breakAndContinue(uint8_t)':
    /Users/PD/Documents/Arduino/libraries/Conceptinetics/Conceptinetics.cpp:386:9: error: 'DMX_UCSRB' was not declared in this scope
    DMX_UCSRB |= (1<<DMX_TXEN);

    ^
    /Users/PD/Documents/Arduino/libraries/Conceptinetics/Conceptinetics.cpp:386:26: error: 'DMX_TXEN' was not declared in this scope
    DMX_UCSRB |= (1<<DMX_TXEN);

    ^
    /Users/PD/Documents/Arduino/libraries/Conceptinetics/Conceptinetics.cpp:391:26: error: 'DMX_TXCIE' was not declared in this scope
    DMX_UCSRB |= (1<<DMX_TXCIE);

    ^
    /Users/PD/Documents/Arduino/libraries/Conceptinetics/Conceptinetics.cpp: In member function 'void RDM_Responder::repondDiscUniqueBranch()':
    /Users/PD/Documents/Arduino/libraries/Conceptinetics/Conceptinetics.cpp:768:9: error: 'DMX_UDR' was not declared in this scope
    DMX_UDR = response[i];

    ^
    /Users/PD/Documents/Arduino/libraries/Conceptinetics/Conceptinetics.cpp: In function 'void SetISRMode(isr::isrMode)':
    /Users/PD/Documents/Arduino/libraries/Conceptinetics/Conceptinetics.cpp:1036:13: error: 'DMX_UBRRH' was not declared in this scope
    DMX_UBRRH = (unsigned char)(((F_CPU + DMX_BAUD_RATE * 8L) / (DMX_BAUD_RATE * 16L) - 1)>>8);

    ^
    /Users/PD/Documents/Arduino/libraries/Conceptinetics/Conceptinetics.cpp:1037:10: error: 'DMX_UBRRL' was not declared in this scope
    DMX_UBRRL = (unsigned char) ((F_CPU + DMX_BAUD_RATE * 8L) / (DMX_BAUD_RATE * 16L) - 1);

    ^
    /Users/PD/Documents/Arduino/libraries/Conceptinetics/Conceptinetics.cpp:1043:13: error: 'DMX_UCSRB' was not declared in this scope
    DMX_UCSRB = (1<<DMX_RXCIE) | (1<<DMX_RXEN);

    ^
    /Users/PD/Documents/Arduino/libraries/Conceptinetics/Conceptinetics.cpp:1043:35: error: 'DMX_RXCIE' was not declared in this scope
    DMX_UCSRB = (1<<DMX_RXCIE) | (1<<DMX_RXEN);

    ^
    /Users/PD/Documents/Arduino/libraries/Conceptinetics/Conceptinetics.cpp:1043:52: error: 'DMX_RXEN' was not declared in this scope
    DMX_UCSRB = (1<<DMX_RXCIE) | (1<<DMX_RXEN);

    ^
    /Users/PD/Documents/Arduino/libraries/Conceptinetics/Conceptinetics.cpp:1047:13: error: 'DMX_UDR' was not declared in this scope
    DMX_UDR = 0x0;

    ^
    /Users/PD/Documents/Arduino/libraries/Conceptinetics/Conceptinetics.cpp:1050:35: error: 'DMX_TXEN' was not declared in this scope
    DMX_UCSRB = (1<<DMX_TXEN) | (1<<DMX_TXCIE);

    ^
    /Users/PD/Documents/Arduino/libraries/Conceptinetics/Conceptinetics.cpp:1050:51: error: 'DMX_TXCIE' was not declared in this scope
    DMX_UCSRB = (1<<DMX_TXEN) | (1<<DMX_TXCIE);

    ^
    /Users/PD/Documents/Arduino/libraries/Conceptinetics/Conceptinetics.cpp:1063:13: error: 'DMX_UCSRA' was not declared in this scope
    DMX_UCSRA = 0x0;

    ^
    /Users/PD/Documents/Arduino/libraries/Conceptinetics/Conceptinetics.cpp: In function 'void USART_TX()':
    /Users/PD/Documents/Arduino/libraries/Conceptinetics/Conceptinetics.cpp:1093:3: error: 'DMX_UCSRA' was not declared in this scope
    DMX_UCSRA = 0x0;

    ^
    /Users/PD/Documents/Arduino/libraries/Conceptinetics/Conceptinetics.cpp:1094:9: error: 'DMX_UBRRH' was not declared in this scope
    DMX_UBRRH = (unsigned char)(((F_CPU + DMX_BREAK_RATE * 8L) / (DMX_BREAK_RATE * 16L) - 1)>>8);

    ^
    /Users/PD/Documents/Arduino/libraries/Conceptinetics/Conceptinetics.cpp:1095:9: error: 'DMX_UBRRL' was not declared in this scope
    DMX_UBRRL = (unsigned char) ((F_CPU + DMX_BREAK_RATE * 8L) / (DMX_BREAK_RATE * 16L) - 1);

    ^
    /Users/PD/Documents/Arduino/libraries/Conceptinetics/Conceptinetics.cpp:1096:9: error: 'DMX_UDR' was not declared in this scope
    DMX_UDR = 0x0;

    ^
    /Users/PD/Documents/Arduino/libraries/Conceptinetics/Conceptinetics.cpp: In function 'void USART_RX()':
    /Users/PD/Documents/Arduino/libraries/Conceptinetics/Conceptinetics.cpp:1176:30: error: 'DMX_UCSRA' was not declared in this scope
    uint8_t usart_state = DMX_UCSRA;

    ^
    /Users/PD/Documents/Arduino/libraries/Conceptinetics/Conceptinetics.cpp:1177:30: error: 'DMX_UDR' was not declared in this scope
    uint8_t usart_data = DMX_UDR;

    ^
    /Users/PD/Documents/Arduino/libraries/Conceptinetics/Conceptinetics.cpp:1183:28: error: 'DMX_FE' was not declared in this scope
    if ( usart_state & (1<<DMX_FE) )

    ^
    Here are the errors for only the ClearPathMotorSD

    Arduino: 1.8.5 (Mac OS X), Board: "4Duino - 2.4""

    /Users/PD/Documents/Arduino/libraries/ClearPathStepGen/ClearPathStepGen.cpp: In member function 'void ClearPathStepGen::Start()':
    /Users/PD/Documents/Arduino/libraries/ClearPathStepGen/ClearPathStepGen.cpp:300:4: error: 'TCCR2A' was not declared in this scope
    TCCR2A = 0;// set entire TCCR2A register to 0
    ^
    /Users/PD/Documents/Arduino/libraries/ClearPathStepGen/ClearPathStepGen.cpp:301:3: error: 'TCCR2B' was not declared in this scope
    TCCR2B = 0;// same for TCCR2B
    ^
    /Users/PD/Documents/Arduino/libraries/ClearPathStepGen/ClearPathStepGen.cpp:302:3: error: 'TCNT2' was not declared in this scope
    TCNT2 = 0;//initialize counter value to 0
    ^
    /Users/PD/Documents/Arduino/libraries/ClearPathStepGen/ClearPathStepGen.cpp:305:3: error: 'OCR2A' was not declared in this scope
    OCR2A = time;// time should be 249, 1-256 will produce different frequencies
    ^
    /Users/PD/Documents/Arduino/libraries/ClearPathStepGen/ClearPathStepGen.cpp:308:19: error: 'WGM21' was not declared in this scope
    TCCR2A |= (1 << WGM21);
    ^
    /Users/PD/Documents/Arduino/libraries/ClearPathStepGen/ClearPathStepGen.cpp:315:3: error: 'TIMSK2' was not declared in this scope
    TIMSK2=0;
    ^
    /Users/PD/Documents/Arduino/libraries/ClearPathStepGen/ClearPathStepGen.cpp:316:19: error: 'OCIE2A' was not declared in this scope
    TIMSK2 |= (1 << OCIE2A);
    ^
    /Users/PD/Documents/Arduino/libraries/ClearPathStepGen/ClearPathStepGen.cpp: In member function 'void ClearPathStepGen::Stop()':
    /Users/PD/Documents/Arduino/libraries/ClearPathStepGen/ClearPathStepGen.cpp:331:4: error: 'TCCR2A' was not declared in this scope
    TCCR2A = 0;// set entire TCCR2A register to 0
    ^
    /Users/PD/Documents/Arduino/libraries/ClearPathStepGen/ClearPathStepGen.cpp:332:3: error: 'TCCR2B' was not declared in this scope
    TCCR2B = 0;// same for TCCR2B
    ^
    /Users/PD/Documents/Arduino/libraries/ClearPathStepGen/ClearPathStepGen.cpp:333:3: error: 'TCNT2' was not declared in this scope
    TCNT2 = 0;//initialize counter value to 0
    ^

    And here are the errors for the ClearPathStepGen

    Arduino: 1.8.5 (Mac OS X), Board: "4Duino - 2.4""

    /Users/PD/Documents/Arduino/libraries/ClearPathStepGen/ClearPathStepGen.cpp: In member function 'void ClearPathStepGen::Start()':
    /Users/PD/Documents/Arduino/libraries/ClearPathStepGen/ClearPathStepGen.cpp:300:4: error: 'TCCR2A' was not declared in this scope
    TCCR2A = 0;// set entire TCCR2A register to 0
    ^
    /Users/PD/Documents/Arduino/libraries/ClearPathStepGen/ClearPathStepGen.cpp:301:3: error: 'TCCR2B' was not declared in this scope
    TCCR2B = 0;// same for TCCR2B
    ^
    /Users/PD/Documents/Arduino/libraries/ClearPathStepGen/ClearPathStepGen.cpp:302:3: error: 'TCNT2' was not declared in this scope
    TCNT2 = 0;//initialize counter value to 0
    ^
    /Users/PD/Documents/Arduino/libraries/ClearPathStepGen/ClearPathStepGen.cpp:305:3: error: 'OCR2A' was not declared in this scope
    OCR2A = time;// time should be 249, 1-256 will produce different frequencies
    ^
    /Users/PD/Documents/Arduino/libraries/ClearPathStepGen/ClearPathStepGen.cpp:308:19: error: 'WGM21' was not declared in this scope
    TCCR2A |= (1 << WGM21);
    ^
    /Users/PD/Documents/Arduino/libraries/ClearPathStepGen/ClearPathStepGen.cpp:315:3: error: 'TIMSK2' was not declared in this scope
    TIMSK2=0;
    ^
    /Users/PD/Documents/Arduino/libraries/ClearPathStepGen/ClearPathStepGen.cpp:316:19: error: 'OCIE2A' was not declared in this scope
    TIMSK2 |= (1 << OCIE2A);
    ^
    /Users/PD/Documents/Arduino/libraries/ClearPathStepGen/ClearPathStepGen.cpp: In member function 'void ClearPathStepGen::Stop()':
    /Users/PD/Documents/Arduino/libraries/ClearPathStepGen/ClearPathStepGen.cpp:331:4: error: 'TCCR2A' was not declared in this scope
    TCCR2A = 0;// set entire TCCR2A register to 0
    ^
    /Users/PD/Documents/Arduino/libraries/ClearPathStepGen/ClearPathStepGen.cpp:332:3: error: 'TCCR2B' was not declared in this scope
    TCCR2B = 0;// same for TCCR2B
    ^
    /Users/PD/Documents/Arduino/libraries/ClearPathStepGen/ClearPathStepGen.cpp:333:3: error: 'TCNT2' was not declared in this scope
    TCNT2 = 0;//initialize counter value to 0
    ^




  • #2
    Hello,

    These libraries are written specifically for the ATMega328 (not the ATmega32u4 inside the 4Duino) and use timers associated just for that. You may be able to port it over to the 32u4 processor but there may be problems using some of the 32u4 timers and it is quite a hard task.

    Best regards

    Paul

    Comment


    • #3
      Thanks for the prompt response. Would it be better for our application then to use one of your other displays with an Arduino Uno? We were hoping to use the 4Duino for this since it is a nice package.

      Would we be able to port the code over that we've created for the 4Duino fairly easily?

      Comment


      • #4
        Hi,

        It's not an easy task to do but it is possible. Using one of the timers can cause the the 32u4 to lock up and I think it it is timer1 but I will check on this. Using any of are gen4 displays is a vaible option as they will run the compiled Uno code via an Arduino Uno nicely. The same programming technique that you have used on the 4Duino can be used on the Uno and the Uno would connect to the gen4 display via Serial and the gen4 Display would be in Serial SPE mode.

        Best regards

        Paul

        Comment

        Working...
        X