AL5D robot and senior project

Again I am not a C# user (probably should learn it more for the fun of it…)
But I have don lots with C and C++ and I have played around with Visual Studio with Visual basic… So my solution may not be 100% correct but hopefully will help.

Yes you need to do the COM.WriteLine… Since you are adding on the CR you may be able to use Write instead…

I would then probably make sure it went out to the SSC-32. In VB would do this like:
COM.BaseStream.Flush();

Also before the command, I would probably Clear the Serial input buffer… An example of what I use in one of my VB apps looks like:

[code] Public Sub ClearInputBuffer(ByRef com1 As IO.Ports.SerialPort)
Dim cbRead As Byte
Dim b(1) As Byte

    com1.DiscardInBuffer()    ' flush out anything we have
    cbRead = 1
    com1.ReadTimeout = 100 'wait a maximum of .1 seconds for a response
    Try
        While cbRead > 0
            cbRead = com1.Read(b, 0, 1)
        End While

    Catch ex As Exception

    End Try
End Sub

[/code]

The Q command returns a single character so you don’t want to use ReadLine, but instead Read(). In VB I would also probably use a timeout in case something went wrong. So I would use a lot of stuff similar to what I did for the ClearInputBuffer above…

Hope that helps
Kurt

Thank you everyone for your help. We were able to finish our project on time and demonstrate in our final presentation for our senior design. Everything went well except my windows form application because I didn’t realize that the projector they had for us for presentation only had 600 x 800 resolution. It didn’t work well. The project went well though.

My next plan now is to get another robot and work on it with my son who is 10. I think he would enjoy working on a project with dad and learning about programming. I am sure I will be visiting this site again soon. Any ideas as to what would be an easy project for someone at an early age to learn how to program. I think we may both start learning how to use Arduino language.