Serial Terminal icon Serial Terminal — PC and EZB serial terminals for ARC: connect, monitor and send text/ASCII to serial devices. Supports COM, flow control, baud, DTR/RTS, hex Try it →
Belgium
Asked — Edited
1 Participant

Vb And Servospeed

Hi,

I use this line of code:

EzB_Connect1.EZB.Servo.SetServoPosition(EZ_B.Servo.ServoPortEnum.D9, 60, 10)

to control a servo. The last integer '10' is the speed setting. However this has no effect at all on the servo speed. I can use 1, 50, 100 etc... it makes no difference. I tried this with Windows XP with VB2005 and with Windows 7 with VB2008. There is no difference.

Suggestions anyone ?

Best regards,


ARC Pro

Upgrade to ARC Pro

ARC Pro will give you immediate updates and new features needed to unleash your robot's potential!

Author Avatar
PRO
Synthiam
LinkedIn Thingiverse Twitter YouTube GitHub
#1  

It works for me, can you post your code?

Author Avatar
Belgium
#2  

Hi DJ,

Sorry it took so long to respond. I was on travel and had to catch up with work when I got back. So this is a little piece of the code:

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

    EzB_Connect1.EZB.Joystick.RefreshState()
   
    'EzB_Connect1.EZB.Servo.SetServoPosition(EZ_B.Servo.ServoPortEnum.D9, SweepServoMin, 100)
    'EzB_Connect1.EZB.Servo.SetServoPosition(EZ_B.Servo.ServoPortEnum.D9, SweepServoMax, 100)

    If SweepStart Then

        PingRadarStatus = True

        EzB_Connect1.EZB.Servo.SetServoPosition(EZ_B.Servo.ServoPortEnum.D9, 10, 1)

        System.Threading.Thread.Sleep(1500)

        EzB_Connect1.EZB.Servo.SetServoPosition(EZ_B.Servo.ServoPortEnum.D9, 60, 10)

        System.Threading.Thread.Sleep(1500)

    End If

End Sub 

The lines commented out I sometimes use for testing with other parameters etc... The If/Then is refering to other code which has no influence. For testing I use the hardcoded values but working with variables has the same result.

Best regards, PhG