Post by shieldbuddy on May 16, 2018 11:37:41 GMT
Hi,
While converting my "Mega" sketch to Shieldbuddy compatible sketch i come accross this problem.
Because of timing conflicts between Neopixels.h liberary and servo.h Adafruit has made there own TiCoServo.h liberary to use servos with neopixels.
There is also this reference (known_16bit_timers.h) nessery in the sketch for this to work.
Now when compiling on Shieldbuddy i get error below.
Now i ask my self if these liberary's are needed? And could the schieldbuddy handel the normal neopix ans servo.h liberary? Maybe in different cores?
Here is the "Arduino Mega" sketch that i'm now trying to convert to shieldbuddy compatible sketch.
link to the MEGA sketch
Arduino: 1.8.0 (Windows 10), Board:"ShieldBuddyTC275_Dx"
Oh and this is the llink to the adafruit explanation and TiCoServo.h. Link to adafruit
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp: In member function 'void Adafruit_TiCoServo::attach(int8_t)':
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:48:51: error: 'OCR1A' was not declared in this scope
ocr = (servoPos_t *)&((p == TIMER1_A_PIN) ? OCR1A : OCR1B);
^
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:48:59: error: 'OCR1B' was not declared in this scope
ocr = (servoPos_t *)&((p == TIMER1_A_PIN) ? OCR1A : OCR1B);
^
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:56:5: error: 'GTCCR' was not declared in this scope
GTCCR = _BV(PWM1B);
^
In file included from <command-line>:0:0:
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:56:17: error: 'PWM1B' was not declared in this scope
GTCCR = _BV(PWM1B);
^
C:\Program Files (x86)\Arduino\hardware\aurduino_Dx/aurix/variants/tc275/Variant.h:122:20: note: in definition of macro '_BV'
#define _BV(a) (1<<a)
^
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:57:5: error: 'TCCR1' was not declared in this scope
TCCR1 = _BV(PWM1A) | _BV(CS13) | _BV(CS11) | _BV(CS10); // 1:1024
^
In file included from <command-line>:0:0:
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:57:17: error: 'PWM1A' was not declared in this scope
TCCR1 = _BV(PWM1A) | _BV(CS13) | _BV(CS11) | _BV(CS10); // 1:1024
^
C:\Program Files (x86)\Arduino\hardware\aurduino_Dx/aurix/variants/tc275/Variant.h:122:20: note: in definition of macro '_BV'
#define _BV(a) (1<<a)
^
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:57:30: error: 'CS13' was not declared in this scope
TCCR1 = _BV(PWM1A) | _BV(CS13) | _BV(CS11) | _BV(CS10); // 1:1024
^
C:\Program Files (x86)\Arduino\hardware\aurduino_Dx/aurix/variants/tc275/Variant.h:122:20: note: in definition of macro '_BV'
#define _BV(a) (1<<a)
^
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:57:42: error: 'CS11' was not declared in this scope
TCCR1 = _BV(PWM1A) | _BV(CS13) | _BV(CS11) | _BV(CS10); // 1:1024
^
C:\Program Files (x86)\Arduino\hardware\aurduino_Dx/aurix/variants/tc275/Variant.h:122:20: note: in definition of macro '_BV'
#define _BV(a) (1<<a)
^
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:57:54: error: 'CS10' was not declared in this scope
TCCR1 = _BV(PWM1A) | _BV(CS13) | _BV(CS11) | _BV(CS10); // 1:1024
^
C:\Program Files (x86)\Arduino\hardware\aurduino_Dx/aurix/variants/tc275/Variant.h:122:20: note: in definition of macro '_BV'
#define _BV(a) (1<<a)
^
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:58:5: error: 'OCR1C' was not declared in this scope
OCR1C = F_CPU / 1024 / 50;
^
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:60:8: error: 'TCNT1' was not declared in this scope
if(TCNT1 > OCR1C) TCNT1 = 0;
^
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp: In member function 'void Adafruit_TiCoServo::toggle()':
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:189:27: error: 'TCCR1' was not declared in this scope
if(pin == TIMER1_A_PIN) TCCR1 ^= _BV(COM1A1);
^
In file included from <command-line>:0:0:
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:189:40: error: 'COM1A1' was not declared in this scope
if(pin == TIMER1_A_PIN) TCCR1 ^= _BV(COM1A1);
^
C:\Program Files (x86)\Arduino\hardware\aurduino_Dx/aurix/variants/tc275/Variant.h:122:20: note: in definition of macro '_BV'
#define _BV(a) (1<<a)
^
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:190:27: error: 'GTCCR' was not declared in this scope
else GTCCR ^= _BV(COM1B1);
^
In file included from <command-line>:0:0:
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:190:40: error: 'COM1B1' was not declared in this scope
else GTCCR ^= _BV(COM1B1);
^
C:\Program Files (x86)\Arduino\hardware\aurduino_Dx/aurix/variants/tc275/Variant.h:122:20: note: in definition of macro '_BV'
#define _BV(a) (1<<a)
^
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp: In member function 'void Adafruit_TiCoServo::write(servoPos_t)':
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:260:9: error: 'TCNT1' was not declared in this scope
while(TCNT1 < *ocr);
^
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp: In member function 'void Adafruit_TiCoServo::detach()':
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:280:9: error: 'TCNT1' was not declared in this scope
while(TCNT1 < *ocr);
^
exit status 1
Fout bij het compileren van board ShieldBuddyTC275_Dx
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
While converting my "Mega" sketch to Shieldbuddy compatible sketch i come accross this problem.
Because of timing conflicts between Neopixels.h liberary and servo.h Adafruit has made there own TiCoServo.h liberary to use servos with neopixels.
There is also this reference (known_16bit_timers.h) nessery in the sketch for this to work.
Now when compiling on Shieldbuddy i get error below.
Now i ask my self if these liberary's are needed? And could the schieldbuddy handel the normal neopix ans servo.h liberary? Maybe in different cores?
Here is the "Arduino Mega" sketch that i'm now trying to convert to shieldbuddy compatible sketch.
link to the MEGA sketch
Arduino: 1.8.0 (Windows 10), Board:"ShieldBuddyTC275_Dx"
Oh and this is the llink to the adafruit explanation and TiCoServo.h. Link to adafruit
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp: In member function 'void Adafruit_TiCoServo::attach(int8_t)':
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:48:51: error: 'OCR1A' was not declared in this scope
ocr = (servoPos_t *)&((p == TIMER1_A_PIN) ? OCR1A : OCR1B);
^
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:48:59: error: 'OCR1B' was not declared in this scope
ocr = (servoPos_t *)&((p == TIMER1_A_PIN) ? OCR1A : OCR1B);
^
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:56:5: error: 'GTCCR' was not declared in this scope
GTCCR = _BV(PWM1B);
^
In file included from <command-line>:0:0:
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:56:17: error: 'PWM1B' was not declared in this scope
GTCCR = _BV(PWM1B);
^
C:\Program Files (x86)\Arduino\hardware\aurduino_Dx/aurix/variants/tc275/Variant.h:122:20: note: in definition of macro '_BV'
#define _BV(a) (1<<a)
^
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:57:5: error: 'TCCR1' was not declared in this scope
TCCR1 = _BV(PWM1A) | _BV(CS13) | _BV(CS11) | _BV(CS10); // 1:1024
^
In file included from <command-line>:0:0:
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:57:17: error: 'PWM1A' was not declared in this scope
TCCR1 = _BV(PWM1A) | _BV(CS13) | _BV(CS11) | _BV(CS10); // 1:1024
^
C:\Program Files (x86)\Arduino\hardware\aurduino_Dx/aurix/variants/tc275/Variant.h:122:20: note: in definition of macro '_BV'
#define _BV(a) (1<<a)
^
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:57:30: error: 'CS13' was not declared in this scope
TCCR1 = _BV(PWM1A) | _BV(CS13) | _BV(CS11) | _BV(CS10); // 1:1024
^
C:\Program Files (x86)\Arduino\hardware\aurduino_Dx/aurix/variants/tc275/Variant.h:122:20: note: in definition of macro '_BV'
#define _BV(a) (1<<a)
^
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:57:42: error: 'CS11' was not declared in this scope
TCCR1 = _BV(PWM1A) | _BV(CS13) | _BV(CS11) | _BV(CS10); // 1:1024
^
C:\Program Files (x86)\Arduino\hardware\aurduino_Dx/aurix/variants/tc275/Variant.h:122:20: note: in definition of macro '_BV'
#define _BV(a) (1<<a)
^
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:57:54: error: 'CS10' was not declared in this scope
TCCR1 = _BV(PWM1A) | _BV(CS13) | _BV(CS11) | _BV(CS10); // 1:1024
^
C:\Program Files (x86)\Arduino\hardware\aurduino_Dx/aurix/variants/tc275/Variant.h:122:20: note: in definition of macro '_BV'
#define _BV(a) (1<<a)
^
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:58:5: error: 'OCR1C' was not declared in this scope
OCR1C = F_CPU / 1024 / 50;
^
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:60:8: error: 'TCNT1' was not declared in this scope
if(TCNT1 > OCR1C) TCNT1 = 0;
^
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp: In member function 'void Adafruit_TiCoServo::toggle()':
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:189:27: error: 'TCCR1' was not declared in this scope
if(pin == TIMER1_A_PIN) TCCR1 ^= _BV(COM1A1);
^
In file included from <command-line>:0:0:
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:189:40: error: 'COM1A1' was not declared in this scope
if(pin == TIMER1_A_PIN) TCCR1 ^= _BV(COM1A1);
^
C:\Program Files (x86)\Arduino\hardware\aurduino_Dx/aurix/variants/tc275/Variant.h:122:20: note: in definition of macro '_BV'
#define _BV(a) (1<<a)
^
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:190:27: error: 'GTCCR' was not declared in this scope
else GTCCR ^= _BV(COM1B1);
^
In file included from <command-line>:0:0:
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:190:40: error: 'COM1B1' was not declared in this scope
else GTCCR ^= _BV(COM1B1);
^
C:\Program Files (x86)\Arduino\hardware\aurduino_Dx/aurix/variants/tc275/Variant.h:122:20: note: in definition of macro '_BV'
#define _BV(a) (1<<a)
^
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp: In member function 'void Adafruit_TiCoServo::write(servoPos_t)':
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:260:9: error: 'TCNT1' was not declared in this scope
while(TCNT1 < *ocr);
^
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp: In member function 'void Adafruit_TiCoServo::detach()':
\\STYLDC03\Home\nermink\Documents\Arduino\libraries\Adafruit_TiCoServo-master\Adafruit_TiCoServo.cpp:280:9: error: 'TCNT1' was not declared in this scope
while(TCNT1 < *ocr);
^
exit status 1
Fout bij het compileren van board ShieldBuddyTC275_Dx
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.