Go to Post 22 motors? Challenge Accepted. - gyroscopeRaptor [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 06-04-2007, 22:37
John Gutmann John Gutmann is offline
I'm right here
AKA: sparksandtabs
FRC #0340 (GRR)
Team Role: Mechanical
 
Join Date: Feb 2005
Rookie Year: 2004
Location: rochester
Posts: 804
John Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant future
Send a message via AIM to John Gutmann Send a message via MSN to John Gutmann Send a message via Yahoo to John Gutmann
Re: VB or any other GUI programmers

Quote:
Originally Posted by 6600gt View Post
I believe I already wrote a similar program for you a while back that you ask for. (written in Visual c++)
Yea that was for 3 servos but this time I am asking for all 8 plus some more bells and whistles. Me and Dr. Nick are having troubles getting it to send over the serial port the right way, mind giving us a hand?

-John
  #2   Spotlight this post!  
Unread 07-04-2007, 11:03
6600gt's Avatar
6600gt 6600gt is offline
Registered User
AKA: Lohit
FRC #0226 (Hammerhead)
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Troy, MI
Posts: 221
6600gt is a jewel in the rough6600gt is a jewel in the rough6600gt is a jewel in the rough
Re: VB or any other GUI programmers

Quote:
Originally Posted by sparksandtabs View Post
Yea that was for 3 servos but this time I am asking for all 8 plus some more bells and whistles. Me and Dr. Nick are having troubles getting it to send over the serial port the right way, mind giving us a hand?

-John
Sure, but I don't know VB. Make sure the start byte is 255 !!!
  #3   Spotlight this post!  
Unread 07-04-2007, 15:21
John Gutmann John Gutmann is offline
I'm right here
AKA: sparksandtabs
FRC #0340 (GRR)
Team Role: Mechanical
 
Join Date: Feb 2005
Rookie Year: 2004
Location: rochester
Posts: 804
John Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant future
Send a message via AIM to John Gutmann Send a message via MSN to John Gutmann Send a message via Yahoo to John Gutmann
Re: VB or any other GUI programmers

Hahaha Yea, well I though you don't know vB I will post the code here anyways, would you be willing to help me out if we can't get it to work in vB because I know you got the one program working before, or could you email me the program is you still have it? I can't seem to find it this way I can play with 3 servos for the time being.

Code:
Public Class Form1

    Dim i As Integer
    Dim Run As Boolean = False
    Dim Mode As String
    Dim Initialized As Boolean = False
    Dim value0 As Integer
    Dim value1 As Integer
    Dim value2 As Integer
    Dim value3 As Integer
    Dim value4 As Integer
    Dim value5 As Integer
    Dim value6 As Integer
    Dim value7 As Integer
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        LED.Hide()
    End Sub

    Private Sub RunBut_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RunBut.Click
        If Run = False Then
            COMPort.PortName = PortName.Text
            COMPort.Open()
            RunBut.Text = "Stop"
            Timer.Enabled = True
            Run = True
            Initialized = True
            Exit Sub
        End If

        If Run = True Then
            COMPort.Close()
            RunBut.Text = "Run"
            Timer.Enabled = False
            Run = False
            Initialized = False
        End If
    End Sub

    Private Sub Timer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer.Tick
        If Initialized = True Then
            If Mode = "Auto" Then
                'We are in auto-send mode so send Data
                'TO DO: Parse Data and send over COM Port
                SendPacket(0, value0)
                SendPacket(1, value1)
                SendPacket(2, value2)
                SendPacket(3, value3)
                SendPacket(4, value4)
                SendPacket(5, value5)
                SendPacket(6, value6)
                SendPacket(7, value7)
            End If
        End If
    End Sub

    Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
        Mode = "Auto"
    End Sub

    Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
        Mode = "Man"
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Mode = "Man" Then
            If Initialized Then
                'We are in Manual send mode, send the data
                'TO DO: Parse data and send
                SendPacket(0, value0)
                SendPacket(1, value1)
                SendPacket(2, value2)
                SendPacket(3, value3)
                SendPacket(4, value4)
                SendPacket(5, value5)
                SendPacket(6, value6)
                SendPacket(7, value7)
            End If
        End If
    End Sub

    Private Sub Serv1bar_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Serv1bar.Scroll
        Serv1box.Text = Serv1bar.Value
        value0 = Serv1bar.Value
    End Sub

    Private Sub Serv2bar_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Serv2bar.Scroll
        Serv2box.Text = Serv2bar.Value
        value1 = Serv2bar.Value
    End Sub

    Private Sub Serv3bar_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Serv3bar.Scroll
        Serv3box.Text = Serv3bar.Value
        value2 = Serv3bar.Value
    End Sub

    Private Sub Serv4bar_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Serv4bar.Scroll
        Serv4box.Text = Serv4bar.Value
        value3 = Serv4bar.Value
    End Sub

    Private Sub Serv5bar_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Serv5bar.Scroll
        Serv5box.Text = Serv5bar.Value
        value4 = Serv5bar.Value
    End Sub
    Private Sub Serv6bar_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Serv6bar.Scroll
        Serv6box.Text = Serv6bar.Value
        value5 = Serv6bar.Value
    End Sub
    Private Sub Serv7bar_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Serv7bar.Scroll
        Serv7box.Text = Serv7bar.Value
        value6 = Serv7bar.Value
    End Sub
    Private Sub Serv8bar_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Serv8bar.Scroll
        Serv8box.Text = Serv8bar.Value
        value7 = Serv8bar.Value
    End Sub

    Private Sub Serv1box_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Serv1box.TextChanged
        Serv1bar.Value = Serv1box.Text
        value0 = Serv1box.Text
    End Sub
    Private Sub Serv2box_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Serv2box.TextChanged
        Serv2bar.Value = Serv2box.Text
        value1 = Serv2box.Text
    End Sub
    Private Sub Serv3box_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Serv3box.TextChanged
        Serv3bar.Value = Serv3box.Text
        value2 = Serv3box.Text
    End Sub
    Private Sub Serv4box_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Serv4box.TextChanged
        Serv4bar.Value = Serv4box.Text
        value3 = Serv4box.Text
    End Sub
    Private Sub Serv5box_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Serv5box.TextChanged
        Serv5bar.Value = Serv5box.Text
        value4 = Serv5box.Text
    End Sub
    Private Sub Serv6box_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Serv6box.TextChanged
        Serv6bar.Value = Serv6box.Text
        value5 = Serv6box.Text
    End Sub
    Private Sub Serv7box_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Serv7box.TextChanged
        Serv7bar.Value = Serv7box.Text
        value6 = Serv7box.Text
    End Sub
    Private Sub Serv8box_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Serv8box.TextChanged
        Serv8bar.Value = Serv8box.Text
        value7 = Serv8box.Text
    End Sub
    Private Sub SendPacket(ByVal servo As Integer, ByVal value As Integer)
        COMPort.Write(255)
        COMPort.Write(servo)
        COMPort.Write(value)
        For i = 1 To 300
            LED.Show()
        Next
        LED.Hide()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        COMPort.Write(255)
        COMPort.Write(0)
        COMPort.Write(127)
    End Sub
End Class
The main problem we are having is that my servo controller isn't receiving correct data. I am unsure fi that is how you send one byte in vB but it doesn't seem to be working. The transmission error light on the controller flashes after every transmission indicating an error.

thanks,
John
  #4   Spotlight this post!  
Unread 07-04-2007, 20:23
6600gt's Avatar
6600gt 6600gt is offline
Registered User
AKA: Lohit
FRC #0226 (Hammerhead)
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Troy, MI
Posts: 221
6600gt is a jewel in the rough6600gt is a jewel in the rough6600gt is a jewel in the rough
Re: VB or any other GUI programmers

I am having a hard time understanding the VB sintax...

Anyway, I am sending the old program and free serial port monitor that you can use to see any data that is being send over the serial port in the zip file.

You might want to use SerialPort instead of COMport
Did you ever set the correct BaudRate?

Serial Port Monitor -> COMx -> DataView
Right Click the Panes to change form HEX to decimal display
Attached Files
File Type: zip free-serial-port-monitor.zip (2.84 MB, 28 views)

Last edited by 6600gt : 07-04-2007 at 20:31.
  #5   Spotlight this post!  
Unread 07-04-2007, 23:17
John Gutmann John Gutmann is offline
I'm right here
AKA: sparksandtabs
FRC #0340 (GRR)
Team Role: Mechanical
 
Join Date: Feb 2005
Rookie Year: 2004
Location: rochester
Posts: 804
John Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant future
Send a message via AIM to John Gutmann Send a message via MSN to John Gutmann Send a message via Yahoo to John Gutmann
Re: VB or any other GUI programmers

Can you change your program so that I can select a serial port? I don't know if you have the source still, And can you send the source? pretty please?

I am having another problem that I will post about in this thread:

http://www.chiefdelphi.com/forums/sh...061#post614061

Last edited by John Gutmann : 07-04-2007 at 23:24.
  #6   Spotlight this post!  
Unread 08-04-2007, 23:09
6600gt's Avatar
6600gt 6600gt is offline
Registered User
AKA: Lohit
FRC #0226 (Hammerhead)
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Troy, MI
Posts: 221
6600gt is a jewel in the rough6600gt is a jewel in the rough6600gt is a jewel in the rough
Re: VB or any other GUI programmers

This has everything. In the release folder you should find the new program.
I had to split up the files cause I can only upload 3mb zips at a time. The data base goes in the original sparksandtabs folder that you will unzip with the sln file.

It will automatically find all the ports on your computer and try to open with the first one and you can choose which other ones to use from the drop down thing on the bottom.

ALSO, if you dial up modems active on your computer they might cause problems with the serial port use. So disable it in the Device Manager.

Oh and I moded it to have the send feature or auto feature you asked for.

Good Luck.
Attached Files
File Type: zip sparksandtabs.zip (2.39 MB, 23 views)
File Type: zip sparks database.zip (2.97 MB, 23 views)
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Any other robots w/Easy C at Boilermaker? Chris_Elston Programming 7 26-03-2006 10:07
Any other NaNoWriMo'ers here? Alex Pelan Chit-Chat 4 16-11-2004 10:14
any other team design bumpers? Alex Cormier General Forum 18 16-03-2003 15:47
Any other Ukrainians here? other then me Alex Cormier Chit-Chat 3 25-02-2003 22:02
Any student programmers going to UCF prog. Comp. archiver 2000 0 23-06-2002 22:56


All times are GMT -5. The time now is 00:18.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi