After some research and tinkering with my Futuba S3003 servo motor and my Netduino Plus 2, i made a small class that can move the servo based on Degree.
With it you are able to move your servo from 0 up to 180°.
The constructor parameters provides:
-Output PWM channel
-PWM frequency
-Min PWM signal duration (for 0°) => 600 us
-Max PWM signal duration (for 180°) => 2400 us
-Max Rotation value i degree => 180°
You can tweak a little bit to move your servo a little bit more (min signal duration can go down to 400us) and your servor can rotate a little bit more than 180°
(see attached file)
How to use:
FutubaS3003 _rangeServo = new FutubaS3003(Cpu.PWMChannel.PWM_0,50, 600, 2400, 180);_rangeServo.Start();_rangeServo.MoveToDegree(0);_rangeServo.MoveToDegree(180);_rangeServo.MoveToDegree(0);_rangeServo.Stop();_rangeServo.Dispose();
Note: The class has no sanity check on wrong values provided to MoveToDegree() function.
-The class will only be working with a Netduino Plus 2 board.
You will need to include the following references to your project:
Microsoft.SPOT.Hardware;
Microsoft.SPOT.Hardware.PWM;
Microsoft.SPOT.Native;
Microsoft.SPOT.Net;
SecretLabs.NETMF.Hardware.Netduino;
SecretLabs.NETMF.Hardwar.NetduinoPlus;
System; FutubaS3003.cs 4.49KB 74 downloads