keyestudio
www.keyestudio.com
Serial.println();
for(int i=0;i<=50;i++) // giving the servo time to rotate to commanded position
{
servopulse(servopin,val);// use the pulse function
}
}
}
*******************************************************************************
Result
When you input a number on serial monitor, the motor rotates to an angle which is equal to the number input, and the angle dimension will be displayed on screen,
as shown in bellow figure.