Hi,
Sparkfun has this code, could you try it please;
/******************************************************************************
servo-skatch.ino
Example sketch for connecting a hobby servo to a sparkfun redboard
(https://www.sparkfun.com/products/9065)
(https://www.sparkfun.com/products/12757)
Byron Jacquot@ SparkFun Electronics
May 17, 2016
**SparkFun code, firmware, and software is released under the MIT License(http://opensource.org/licenses/MIT).**
Development environment specifics:
Arduino 1.6.5
******************************************************************************/
#include <Servo.h>
Servo testservo;
uint32_t next;
void setup()
{
// the 1000 & 2000 set the pulse width
// mix & max limits, in microseconds.
// Be careful with shorter or longer pulses.
testservo.attach(9, 1000, 2000);
next = millis() + 500;
}
void loop()
{
static bool rising = true;
if(millis() > next)
{
if(rising)
{
testservo.write(180);
rising = false;
}
else
{
testservo.write(0);
rising = true;
}
// repeat again in 3 seconds.
next += 3000;
}
}
It should try and give you full swing, It is coded for pin 9.
I have doubts like some others here about if your servo is built to go full 180Deg.
The fact that it is called a "Steering Servo", the difference appears to be torque and speed, greater in both cases.
But it could also be the turn angle.
It's a car/buggy steering servo, they often only need a range of around 90-100 degrees. Also the fact that you say it does not respond to write(30) means that it cannot handle the wide signal range that the default servo.attach() gives you (544-2400us).
You need a different servo but be aware that many large servos will not give a full 180 degree range. And unfortunately it's something that is rarely quoted in hobby servo specifications.
Servos are controlled by pulses of 1...2ms length that repeat every 20ms. The length of the pulse defines the position of the servo. Many servos can respond to pulses <1ms or >2ms. This gives a wider spread of movement.
The servo lib maps the 'angle' 0..180 to a pulsewidth of 0.55ms to about 2.4ms. So this is not really an angle. It depends on the servo how wide the range is. And not all servos can respond do pulses of 0.55ms or 2.4ms. Digital servos check the pulsewidth, and if it's outside their range, they will ignore that pulse completely.
Only few servos can really span a movement of 180°. if they can, it is mostly written in the servo data. Therefore it is most likely, that your servo cannot do this.
Most hobby servos cannot do 180 degrees, as you have found, as they are not
designed to do this, they are designed to move ailerons etc on a model plane.
A decent robotics-grade servo with a datasheet is where to look - no datasheet,
no guarantee of anything with cheap RC components.