Im creating a robot and i keep getting this message[Error compiling for board]

i keep getting this error messege Error compiling for board Adafruit Trinket (ATtiny85 @ 16MHz). im new to arduino but it been programing for 2 years this code is for a robot using the adafruit trinket 3v at 16mhz connected to 2 servos and an hm-10 bt component i keep gettng this error over and over again and im not sure whats wrong.

#include <SoftwareSerial.h>
#include <Servo.h> 
///7007 back to original
const int x=1;
const int y=2;
Servo Servo1; 
Servo Servo2; 
SoftwareSerial BTSerial(x,y); //RX|TX

void setup(){
 BTSerial.begin(9600); // default baud rate
 int servoPin = 3; 
 int servoPin2 = 4; 
// Create a servo object 

 int x = 1001;

void loop(){
 //read from the HM-10 and print in the Serial
 if(BTSerial.available()== x)
   if(BTSerial.available()== x * 7)


heres the error

C:\Program Files (x86)\Arduino\libraries\Servo\src\avr\Servo.cpp: In function 'void __vector_3()':

C:\Program Files (x86)\Arduino\libraries\Servo\src\avr\Servo.cpp:82:44: error: cannot convert 'volatile uint8_t* {aka volatile unsigned char*}' to 'volatile uint16_t* {aka volatile unsigned int*}' for argument '2' to 'void handle_interrupts(timer16_Sequence_t, volatile uint16_t*, volatile uint16_t*)'

   handle_interrupts(_timer1, &TCNT1, &OCR1A);


C:\Program Files (x86)\Arduino\libraries\Servo\src\avr\Servo.cpp: In function 'void initISR(timer16_Sequence_t)':

C:\Program Files (x86)\Arduino\libraries\Servo\src\avr\Servo.cpp:129:5: error: 'TCCR1B' was not declared in this scope

     TCCR1B = _BV(CS11);     // set prescaler of 8


C:\Program Files (x86)\Arduino\libraries\Servo\src\avr\Servo.cpp:136:5: error: 'TIFR1' was not declared in this scope

     TIFR1 |= _BV(OCF1A);     // clear any pending interrupts;


C:\Program Files (x86)\Arduino\libraries\Servo\src\avr\Servo.cpp:137:5: error: 'TIMSK1' was not declared in this scope

     TIMSK1 |=  _BV(OCIE1A) ; // enable the output compare interrupt


Using library SoftwareSerial at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SoftwareSerial 
Using library Servo at version 1.1.2 in folder: C:\Program Files (x86)\Arduino\libraries\Servo 
exit status 1
Error compiling for board Adafruit Trinket (ATtiny85 @ 16MHz).

Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added.

It looks like the Servo library is simply not compatible with a Trinket with an ATtiny85 processor.


Hello there!

The Servo library is a known prankster, and can cause numerous errors with the timers on the chip. I would recommend switching Servo with ServoTimer2 and see what happens.

Note that ServoTimer2 member functions take different arguments, so it would be a good idea to read up on it before using (maybe run an example sketch).

But slipstick could be correct in that the library is not compatible with the Attiny you are using.

[Do you what a possible alternative to what i have now?/s]

You could always try ATtiny Hacks: ATtiny45/85 Servo Library | Hackaday

(I just Googled "servo library for attiny85", I haven't tried it myself).


Alight thank you so much