I coded on servo.h library but now i need to use PCA9685, how can i use PCA9685 with Servo.h library.
Adafruit has a PCA9685 servo example.
You can’t. They work in completely different ways. And there is no simple 1 to 1 conversion from Servo.h code to code that uses a PCA9685, with or without a library.
So, i need to rewrite my source code then.
What about memory, adafruit libraries are so big.
No information to answer with. I don’t know what Arduino you’re using or what additional devices, code and libraries you need in your program or how complex it is.
I’ve used the Adafruit_PWMServo library on Nanos which have very little memory, though not with very complex programs.
This is not related with this topic but i will use mpu9250 and mpu6050, libraries just for two of these taked 90% memory of nano and i’ll use for pca9865 and for other things, do you think should i buy bigger arduino or could i trim libraries.
Any reason you want to use the Nano, rather than others with faster processing and memory.
If you are adding more and more peripherals you may need to step up in controller capacity.
Have you looked at ESP32 or STM devices?
You could have a look at the new-ish Nano Every. More memory, better processor but otherwise very similar.