Help me to rotating this fan

Video_00409

BLYNK_WRITE(V27) {
  Speed = param.asInt();
  if (Speed>0){
    Blynk.virtualWrite(V0, 1); //image indexing starts from 1
  }else{
    Blynk.virtualWrite(V0, 2); //image indexing starts from 2
  }
 }

void Fan() {
  if (Speed>0){
  R = R + (10*Speed);
  if (R >= 360) {
    R = 0;
  }
    Blynk.setProperty(V0, "rotation", R); //0-360 degrees
  }
}
1 Like