Pages: [1]   Go Down
Author Topic: Servo library error when compiling - SOLVED  (Read 710 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 53
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello all,

I just wanted to use servo library for my Due first time, but it does not work.
So I downloaded latest IDE 1.5.5 where is servo library included.

I have opened example sketch "sweep" and during compilation it shows this error:

C:\Users\Miro\Documents\Arduino\libraries\Servo\Servo.cpp:103: error: expected constructor, destructor, or type conversion before '(' token
C:\Users\Miro\Documents\Arduino\libraries\Servo\Servo.cpp: In function 'void initISR(timer16_Sequence_t)':
C:\Users\Miro\Documents\Arduino\libraries\Servo\Servo.cpp:151: error: 'TCCR1A' was not declared in this scope
C:\Users\Miro\Documents\Arduino\libraries\Servo\Servo.cpp:152: error: 'TCCR1B' was not declared in this scope
C:\Users\Miro\Documents\Arduino\libraries\Servo\Servo.cpp:152: error: 'CS11' was not declared in this scope
C:\Users\Miro\Documents\Arduino\libraries\Servo\Servo.cpp:152: error: '_BV' was not declared in this scope
C:\Users\Miro\Documents\Arduino\libraries\Servo\Servo.cpp:153: error: 'TCNT1' was not declared in this scope
C:\Users\Miro\Documents\Arduino\libraries\Servo\Servo.cpp:159: error: 'TIFR1' was not declared in this scope
C:\Users\Miro\Documents\Arduino\libraries\Servo\Servo.cpp:159: error: 'OCF1A' was not declared in this scope
C:\Users\Miro\Documents\Arduino\libraries\Servo\Servo.cpp:160: error: 'TIMSK1' was not declared in this scope
C:\Users\Miro\Documents\Arduino\libraries\Servo\Servo.cpp:160: error: 'OCIE1A' was not declared in this scope
C:\Users\Miro\Documents\Arduino\libraries\Servo\Servo.cpp: In member function 'void Servo::writeMicroseconds(int)':
C:\Users\Miro\Documents\Arduino\libraries\Servo\Servo.cpp:311: error: 'SREG' was not declared in this scope
C:\Users\Miro\Documents\Arduino\libraries\Servo\Servo.cpp:312: error: 'cli' was not declared in this scope

When I choose board Arduino Mega this error disappear:(

Anyone have any advice?
Thank you in advance. Best regards Miro
« Last Edit: January 07, 2014, 03:05:54 pm by zmatek » Logged

Perth, Australia
Offline Offline
Newbie
*
Karma: 3
Posts: 9
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

These errors say that it is using a library made for an AVR chip ( uno, mega )

There is supposed to be a library for the due, you may need to delete the library in your documents\arduino\libraries folder
Logged

0
Offline Offline
Shannon Member
****
Karma: 200
Posts: 11672
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

1.5 distribution should not be sharing anything with 1.0 distributions, lots of things
are moved about and restructured...
Logged

[ I won't respond to messages, use the forum please ]

Offline Offline
Jr. Member
**
Karma: 0
Posts: 53
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So question is what I have done wrong?

I did not any changes, I have installed latest IDE release 1.5.5
I loaded default example, setup up correct port , DUE programming port and that error occurs    smiley-roll

I also tried to use IDE 1.5.2r2 and library from GITHUB manually uploaded into ...arduino/hardware/arduino/sam/library
Also does not work for me...

Does this library work for you guys with DUE? Is there needed some modification?
I have been looking for a solution in the google for 3 hours at least, but it seems nobody has similar problem with IDE 1.5.1 and above.
I am working in Windows 7 64bit system if is it matter.
I can control servo without library of course, but I think that software timer for PPM generation will consume a lot of CPU capacity.

So once more again, thank you for any help. Miro
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 53
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

These errors say that it is using a library made for an AVR chip ( uno, mega )

There is supposed to be a library for the due, you may need to delete the library in your documents\arduino\libraries folder

Hi dude,

thanks a lot you were absolutelly right.
I have deleted files in this folder: \Arduino\libraries\Servo\arch\avr\
And problem with compilation disapperas: )

However still we have a question, why IDE used these files for AVR instead of files for SAM when DUE board selected smiley

Logged

Pages: [1]   Go Up
Jump to: