PARALLAX 28830 Servo sourcecode VB.NET
111178Michel
Posts: 1
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
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
http://www.google.com/search?sourceid=navclient&ie=UTF-8&rlz=1T4GGIH_enUS316US316&q=basic+code+sample+written+in+VB.NET%2bservo
Dave
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dave Andreae
Parallax Tech Support·
http://forums.parallax.com/showthread.php?p=671804
Jeff T.
·