Shop OBEX P1 Docs P2 Docs Learn Events
PARALLAX 28830 Servo sourcecode VB.NET — Parallax Forums

PARALLAX 28830 Servo sourcecode VB.NET

111178Michel111178Michel Posts: 1
edited 2010-04-24 02:25 in Robotics
Hello, can somebody help me with a basic code sample written in VB.NET.


Public MSComm1 As MSCommLib.MSComm

Private Sub Form_Load()
MSComm1.Settings = "2400,N,8,1" <(NOT SURE)
MSComm1.CommPort = 3
MSComm1.PortOpen = True
End Sub

Private Sub VScroll1_Change()

Dim cmd
Dim port
Dim pos
Dim speed
Dim cmdstr

cmd = "!SC" '!SC <(NOT SURE)
port = 0
pos = VScroll1.Value
speed = 7


MSComm1.DTREnable = True
MSComm1.PortOpen = True
cmdstr = cmd + Chr(port) + Chr(speed) + Chr(pos Mod 256) + Chr(pos \ 256) + vbCrLf <(NOT SURE)

'Debug.Print cmdstr

MSComm1.Output = cmdstr
MSComm1.PortOpen = False



End Sub

Private Sub VScroll1_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles VScroll1.ValueChanged
VScroll1_Change()
End Sub

Do you have a better alternative, please let me know.

I'm building a robot with 16+ servo's but i need some help!

Now i'm using the standard software for basic movement that's available on the parallax site.
I am a .NET Programmer but i can't find a simple base to start from.

Thanx. Michel

Comments

Sign In or Register to comment.