And my second problem. I power Digispark from USB, Micro servo from a separate 5V power supply with common gnd, I found the code on the internet and it's supposed to work, but the servo doesn't move but just shakes a few degrees left and right and doesn't stop.
#include <SoftwareServo.h>
SoftwareServo myservo;
void setup(){
myservo.attach(0);
}
void loop(){
myservo.write(180);
delay_refresh(2000);
myservo.write(0);
delay_refresh(2000);
}
void delay_refresh(int delaytime){
for(int x=0; x<delaytime; x=x+20){
delay(20);
SoftwareServo::refresh();
}
}