Hi
Am am new at this but have little bit of experience in Visual Basic.
I am using VB 2010 Express.
All I want is for my servo to move I have been at this for two days.
My servo is a Hitec HS-5645MG. Yellow is connected to Digital pin 9 and Black and red to a 6v external power.
I have also tried connecting power directly to the NP2.
What is wrong with my code?
Imports Microsoft.SPOT
Imports Microsoft.SPOT.Hardware
Imports SecretLabs.NETMF.Hardware
Imports SecretLabs.NETMF.Hardware.Netduino
Module Module1
Sub Main()
[color=#006400;]'Hitec HS-5645MG - Digital High Torque Servo ---Pulse Cycle:20 ms Pulse Width: 900-2100 µs[/color]
Dim pwm As New PWM(PWMChannels.PWM_PIN_D9, 20000, 1500, pwm.ScaleFactor.Microseconds, False)
Const period As UInteger = 20 * 1000 * 1000 [color=#006400;] ' 20 ms[/color]
Const duration As UInteger = 20 * 1000 * 1000[color=#006400;] ' 1 ms[/color]
pwm.Duration = (period And duration)
Thread.Sleep(100)
End Sub
End Module