Sparkfun Display - VB serial Interface Problem?

Here is my code for the serial interface. pretty simple... though i'm running into a few problems..

Sending commands... i have no clue nor can i remember how i did it before..

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        SerialPort1.Write(TextBox1.Text)
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Try
            SerialPort1.Open()
        Catch ex As Exception
            MsgBox("Port does not exist")
        End Try
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Try
            SerialPort1.Close()
        Catch ex As Exception
            MsgBox("Port already closed")
        End Try
    End Sub

    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
        SerialPort1.BaudRate = ComboBox1.SelectedItem
    End Sub

    Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
        SerialPort1.PortName = "COM" + ComboBox2.SelectedItem
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Label1.Text = "Information:" + vbCrLf + "Serial Port: " + SerialPort1.PortName.ToString + vbCrLf + "Baud Rate: " + SerialPort1.BaudRate.ToString + vbCrLf + "Port Open:" + SerialPort1.IsOpen.ToString
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        Dim i As Integer
        Do While i <= 168
            SerialPort1.Write(" ")
            i += 1
        Loop
        i = 0
    End Sub
End Class

 

Here is the link to the display if anyone has an idea..

http://www.sparkfun.com/datasheets/LCD/Monochrome/Corrected-SFE-0016-DataSheet-08884-SerialGraphicLCD-v2.pdf

Thanks!

I have not done much with VB.

The display you linked to says that, unless you change settings on the backpack, it is expecting 115,200 baud, 8 data, 1 stop bit, and no parity. I could be wrong, but, don’t you need to set all that up in your VB program when attempting to talk to a serial connection?

birdman, i already have the

birdman, i already have the ability to write to the screen at 9600baudR, the only problem i have is with the commands being sent to the screen such as &h7C ect

I just need hep figuring out how to write the command directly from the vb application to the display such as clearing the screen

The only other assistance I can offer at the moment

is to ask if you have looked at http://www.andreavb.com/forum/viewtopic.php?TopicID=7915

 

PERFECT!

THANKS BIRDMAN!!

SerialPort1.Write(Chr(&H7C) & Chr(&H0))  <-- clears the screen THANKS ALLOT!

No problem

I just did a search on VB and serial communication and that was one of the first few hits that came up.