I'll keep editing this post with up to date, better working code and leave the original post alone since it's the absolute basics needed to get started.
The first post shows you how to create a simple scrollbar control for a single servo. This post shows you how to create a Walk Forward control. It will just walk 2 steps forward then stop until you hit the button again. I don't have it looping yet but am working on a routine to do that.
Here's what I have so far. Keep in mind, I'm not trying to create a great piece of software like the Sequencer, RIOS, or even LynxTerm - this is just to see how the new language works for robotics. I'd also like to work with MSRS a bit but wanted to get a little more VB experience in first.
Code:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
SerialPort1.Open()
End Sub
Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' RA, RK, RH, LA, LK, LH, speed Walk Forward - SEQ Servo Order
SerialPort1.Write("#0 P1427 #1 P1292 #2 P1292 #16 P1573 #17 P1708 #18 P1708 T500" + Chr(13))
Sleep(900)
SerialPort1.Write("#0 P1573 #1 P1292 #2 P1292 #16 P1427 #17 P1708 #18 P1708 T500" + Chr(13))
Sleep(900)
SerialPort1.Write("#0 P1573 #1 P1708 #2 P1708 #16 P1427 #17 P1292 #18 P1292 T500" + Chr(13))
Sleep(900)
SerialPort1.Write("#0 P1427 #1 P1708 #2 P1708 #16 P1573 #17 P1292 #18 P1292 T500" + Chr(13))
Sleep(900)
End Sub
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
'RA, RK, RH, LA, LK, LH, speed Home Position
SerialPort1.Write("#0 P1500 #1 P1500 #2 P1500 #16 P1500 #17 P1500 #18 P1500 T500" + Chr(13))
End Sub
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
'RA, RK, RH, LA, LK, LH, speed Servos off
SerialPort1.Write("#0 P0 #1 P0 #2 P0 #16 P0 #17 P0 #18 P0 T500" + Chr(13))
End Sub
End Class
If you have any interest in working with this, you'll need to drag over the appropriate objects on the form too. Here's a screenshot of what it looks like so far:
Here's a video of some of the basic functions so far:
http://www.youtube.com/watch?v=cqfxVHDOm1Y