arduino-libraries / Servo

Servo Library for Arduino
http://arduino.cc/
GNU Lesser General Public License v2.1
233 stars 251 forks source link

Add support for ATtiny85 #81

Open GeorgeM987 opened 3 years ago

GeorgeM987 commented 3 years ago

Have tried using the versions above with an Attiny85 but got a few errors comeback:

.pio\libdeps\attiny85\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*)'

.pio\libdeps\attiny85\Servo\src\avr\Servo.cpp:128:5: error: 'TCCR1A' was not declared in this scope

.pio\libdeps\attiny85\Servo\src\avr\Servo.cpp:129:5: error: 'TCCR1B' was not declared in this scope

.pio\libdeps\attiny85\Servo\src\avr\Servo.cpp:136:5: error: 'TIFR1' was not declared in this scope

.pio\libdeps\attiny85\Servo\src\avr\Servo.cpp:137:5: error: 'TIMSK1' was not declared in this scope

Was just wondering if these are an easy fix, or if it's something I'm missing?!

Regards, George M.

per1234 commented 2 years ago

These errors is because the library does not currently support the ATtiny85. Until such time as Arduino might add such support, I will recommend the excellent ATTinyCore boards platform, the installation of which includes a "Servo_ATTinyCore" library supporting the ATtiny85:

https://github.com/SpenceKonde/ATTinyCore/blob/master/avr/extras/ATtiny_x5.md#servo-support

As for PlatformIO users, I can only suggest looking for an alternative 3rd party Servo library.