Public Class Form1
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "
    Dim start As String = "11111111"
    Dim finish As String = "00000000"
    Dim code As String = "00000000"
    Dim code1 As String = "00000001"
    Dim code2 As String = "00000001"
    Dim code3 As String = "00000001"
    Dim count As Int16 = 0
    Dim line As Int16 = 1200
    Dim lines As Int16 = 1200
    Public Sub New()
        MyBase.New()

        'This call is requiblue by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Requiblue by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is requiblue by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents Label4 As System.Windows.Forms.Label
    Friend WithEvents Label5 As System.Windows.Forms.Label
    Friend WithEvents Label6 As System.Windows.Forms.Label
    Friend WithEvents Label7 As System.Windows.Forms.Label
    Friend WithEvents Label8 As System.Windows.Forms.Label
    Friend WithEvents Button1 As System.Windows.Forms.Button
    Friend WithEvents Label11 As System.Windows.Forms.Label
    Friend WithEvents Label12 As System.Windows.Forms.Label
    Friend WithEvents Label13 As System.Windows.Forms.Label
    Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
    Friend WithEvents Timer1 As System.Windows.Forms.Timer
    Friend WithEvents Timer2 As System.Windows.Forms.Timer
    Friend WithEvents Button2 As System.Windows.Forms.Button
    Friend WithEvents Button0 As System.Windows.Forms.Button
    Friend WithEvents Button3 As System.Windows.Forms.Button
    Friend WithEvents Label14 As System.Windows.Forms.Label
    Friend WithEvents Label21 As System.Windows.Forms.Label
    Friend WithEvents Label22 As System.Windows.Forms.Label
    Friend WithEvents Label23 As System.Windows.Forms.Label
    Friend WithEvents Label24 As System.Windows.Forms.Label
    Friend WithEvents Label25 As System.Windows.Forms.Label
    Friend WithEvents Label26 As System.Windows.Forms.Label
    Friend WithEvents Label27 As System.Windows.Forms.Label
    Friend WithEvents Label28 As System.Windows.Forms.Label
    Friend WithEvents Label29 As System.Windows.Forms.Label
    Friend WithEvents Button4 As System.Windows.Forms.Button
    Friend WithEvents Button5 As System.Windows.Forms.Button
    Friend WithEvents Label9 As System.Windows.Forms.Label
    Friend WithEvents Label10 As System.Windows.Forms.Label
    Friend WithEvents Label15 As System.Windows.Forms.Label
    Friend WithEvents Label16 As System.Windows.Forms.Label
    Friend WithEvents Label17 As System.Windows.Forms.Label
    Friend WithEvents Label18 As System.Windows.Forms.Label
    Friend WithEvents Label19 As System.Windows.Forms.Label
    Friend WithEvents Button8 As System.Windows.Forms.Button
    Friend WithEvents Button9 As System.Windows.Forms.Button
    Friend WithEvents Label20 As System.Windows.Forms.Label
    Friend WithEvents Label30 As System.Windows.Forms.Label
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container()
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
        Me.Label1 = New System.Windows.Forms.Label()
        Me.Label2 = New System.Windows.Forms.Label()
        Me.Label3 = New System.Windows.Forms.Label()
        Me.Label4 = New System.Windows.Forms.Label()
        Me.Label5 = New System.Windows.Forms.Label()
        Me.Label6 = New System.Windows.Forms.Label()
        Me.Label7 = New System.Windows.Forms.Label()
        Me.Label8 = New System.Windows.Forms.Label()
        Me.Button1 = New System.Windows.Forms.Button()
        Me.Label11 = New System.Windows.Forms.Label()
        Me.Label12 = New System.Windows.Forms.Label()
        Me.Label13 = New System.Windows.Forms.Label()
        Me.TextBox1 = New System.Windows.Forms.TextBox()
        Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
        Me.Timer2 = New System.Windows.Forms.Timer(Me.components)
        Me.Button2 = New System.Windows.Forms.Button()
        Me.Button0 = New System.Windows.Forms.Button()
        Me.Button3 = New System.Windows.Forms.Button()
        Me.Label14 = New System.Windows.Forms.Label()
        Me.Label21 = New System.Windows.Forms.Label()
        Me.Label22 = New System.Windows.Forms.Label()
        Me.Label23 = New System.Windows.Forms.Label()
        Me.Label24 = New System.Windows.Forms.Label()
        Me.Label25 = New System.Windows.Forms.Label()
        Me.Label26 = New System.Windows.Forms.Label()
        Me.Label27 = New System.Windows.Forms.Label()
        Me.Label28 = New System.Windows.Forms.Label()
        Me.Label29 = New System.Windows.Forms.Label()
        Me.Button4 = New System.Windows.Forms.Button()
        Me.Button5 = New System.Windows.Forms.Button()
        Me.Label9 = New System.Windows.Forms.Label()
        Me.Label10 = New System.Windows.Forms.Label()
        Me.Label15 = New System.Windows.Forms.Label()
        Me.Label16 = New System.Windows.Forms.Label()
        Me.Label17 = New System.Windows.Forms.Label()
        Me.Label18 = New System.Windows.Forms.Label()
        Me.Label19 = New System.Windows.Forms.Label()
        Me.Button8 = New System.Windows.Forms.Button()
        Me.Button9 = New System.Windows.Forms.Button()
        Me.Label20 = New System.Windows.Forms.Label()
        Me.Label30 = New System.Windows.Forms.Label()
        Me.SuspendLayout()
        '
        'Label1
        '
        Me.Label1.BackColor = System.Drawing.Color.Black
        Me.Label1.Location = New System.Drawing.Point(0, 3)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(1200, 1)
        Me.Label1.TabIndex = 0
        '
        'Label2
        '
        Me.Label2.BackColor = System.Drawing.Color.Black
        Me.Label2.Location = New System.Drawing.Point(0, 5)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(1200, 1)
        Me.Label2.TabIndex = 1
        '
        'Label3
        '
        Me.Label3.BackColor = System.Drawing.Color.Black
        Me.Label3.Location = New System.Drawing.Point(0, 7)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(1200, 1)
        Me.Label3.TabIndex = 2
        '
        'Label4
        '
        Me.Label4.BackColor = System.Drawing.Color.Black
        Me.Label4.Location = New System.Drawing.Point(0, 9)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(1200, 1)
        Me.Label4.TabIndex = 3
        '
        'Label5
        '
        Me.Label5.BackColor = System.Drawing.Color.Black
        Me.Label5.Location = New System.Drawing.Point(0, 11)
        Me.Label5.Name = "Label5"
        Me.Label5.Size = New System.Drawing.Size(1200, 1)
        Me.Label5.TabIndex = 4
        '
        'Label6
        '
        Me.Label6.BackColor = System.Drawing.Color.Black
        Me.Label6.Location = New System.Drawing.Point(0, 13)
        Me.Label6.Name = "Label6"
        Me.Label6.Size = New System.Drawing.Size(1200, 1)
        Me.Label6.TabIndex = 5
        '
        'Label7
        '
        Me.Label7.BackColor = System.Drawing.Color.Black
        Me.Label7.Location = New System.Drawing.Point(0, 15)
        Me.Label7.Name = "Label7"
        Me.Label7.Size = New System.Drawing.Size(1200, 1)
        Me.Label7.TabIndex = 6
        '
        'Label8
        '
        Me.Label8.BackColor = System.Drawing.Color.Black
        Me.Label8.Location = New System.Drawing.Point(0, 17)
        Me.Label8.Name = "Label8"
        Me.Label8.Size = New System.Drawing.Size(1200, 1)
        Me.Label8.TabIndex = 7
        '
        'Button1
        '
        Me.Button1.Cursor = System.Windows.Forms.Cursors.Arrow
        Me.Button1.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Popup
        Me.Button1.Font = New System.Drawing.Font("Times New Roman", 27.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Button1.ForeColor = System.Drawing.Color.Yellow
        Me.Button1.Location = New System.Drawing.Point(24, 248)
        Me.Button1.Name = "Button1"
        Me.Button1.Size = New System.Drawing.Size(152, 80)
        Me.Button1.TabIndex = 10
        Me.Button1.Text = "Lounge    ON"
        '
        'Label11
        '
        Me.Label11.Font = New System.Drawing.Font("Microsoft Sans Serif", 36.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label11.ForeColor = System.Drawing.Color.Yellow
        Me.Label11.Location = New System.Drawing.Point(688, 40)
        Me.Label11.Name = "Label11"
        Me.Label11.Size = New System.Drawing.Size(232, 48)
        Me.Label11.TabIndex = 11
        Me.Label11.Text = "Time"
        Me.Label11.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
        '
        'Label12
        '
        Me.Label12.Font = New System.Drawing.Font("Microsoft Sans Serif", 26.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label12.ForeColor = System.Drawing.Color.LightGray
        Me.Label12.Location = New System.Drawing.Point(32, 48)
        Me.Label12.Name = "Label12"
        Me.Label12.Size = New System.Drawing.Size(200, 64)
        Me.Label12.TabIndex = 12
        Me.Label12.Text = "Key Press"
        Me.Label12.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
        '
        'Label13
        '
        Me.Label13.Font = New System.Drawing.Font("Microsoft Sans Serif", 36.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label13.ForeColor = System.Drawing.Color.Blue
        Me.Label13.Location = New System.Drawing.Point(112, 160)
        Me.Label13.Name = "Label13"
        Me.Label13.Size = New System.Drawing.Size(736, 64)
        Me.Label13.TabIndex = 13
        Me.Label13.Text = "Equipment"
        Me.Label13.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
        '
        'TextBox1
        '
        Me.TextBox1.BackColor = System.Drawing.Color.Black
        Me.TextBox1.BorderStyle = System.Windows.Forms.BorderStyle.None
        Me.TextBox1.Font = New System.Drawing.Font("Microsoft Sans Serif", 27.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TextBox1.ForeColor = System.Drawing.Color.White
        Me.TextBox1.Location = New System.Drawing.Point(-8, 168)
        Me.TextBox1.Name = "TextBox1"
        Me.TextBox1.Size = New System.Drawing.Size(64, 42)
        Me.TextBox1.TabIndex = 1
        Me.TextBox1.Text = ""
        '
        'Timer1
        '
        Me.Timer1.Interval = 80
        '
        'Timer2
        '
        Me.Timer2.Enabled = True
        Me.Timer2.Interval = 50
        '
        'Button2
        '
        Me.Button2.Cursor = System.Windows.Forms.Cursors.Arrow
        Me.Button2.FlatStyle = System.Windows.Forms.FlatStyle.Popup
        Me.Button2.Font = New System.Drawing.Font("Times New Roman", 27.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Button2.ForeColor = System.Drawing.Color.Yellow
        Me.Button2.ImageAlign = System.Drawing.ContentAlignment.MiddleRight
        Me.Button2.Location = New System.Drawing.Point(192, 248)
        Me.Button2.Name = "Button2"
        Me.Button2.Size = New System.Drawing.Size(152, 80)
        Me.Button2.TabIndex = 14
        Me.Button2.Text = "Lounge    OFF"
        '
        'Button0
        '
        Me.Button0.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.Button0.Location = New System.Drawing.Point(944, 24)
        Me.Button0.Name = "Button0"
        Me.Button0.Size = New System.Drawing.Size(75, 32)
        Me.Button0.TabIndex = 16
        '
        'Button3
        '
        Me.Button3.Cursor = System.Windows.Forms.Cursors.Arrow
        Me.Button3.FlatStyle = System.Windows.Forms.FlatStyle.Popup
        Me.Button3.Font = New System.Drawing.Font("Wingdings 3", 72.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(2, Byte))
        Me.Button3.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Button3.Location = New System.Drawing.Point(376, 248)
        Me.Button3.Name = "Button3"
        Me.Button3.Size = New System.Drawing.Size(104, 96)
        Me.Button3.TabIndex = 17
        Me.Button3.Text = "P"
        '
        'Label14
        '
        Me.Label14.BackColor = System.Drawing.Color.Black
        Me.Label14.Location = New System.Drawing.Point(16, 160)
        Me.Label14.Name = "Label14"
        Me.Label14.Size = New System.Drawing.Size(1032, 576)
        Me.Label14.TabIndex = 18
        Me.Label14.Text = "Label14"
        '
        'Label21
        '
        Me.Label21.BackColor = System.Drawing.Color.Blue
        Me.Label21.Location = New System.Drawing.Point(0, 2)
        Me.Label21.Name = "Label21"
        Me.Label21.Size = New System.Drawing.Size(1200, 1)
        Me.Label21.TabIndex = 25
        '
        'Label22
        '
        Me.Label22.BackColor = System.Drawing.Color.Blue
        Me.Label22.Location = New System.Drawing.Point(0, 4)
        Me.Label22.Name = "Label22"
        Me.Label22.Size = New System.Drawing.Size(1200, 1)
        Me.Label22.TabIndex = 26
        '
        'Label23
        '
        Me.Label23.BackColor = System.Drawing.Color.Blue
        Me.Label23.Location = New System.Drawing.Point(0, 6)
        Me.Label23.Name = "Label23"
        Me.Label23.Size = New System.Drawing.Size(1200, 1)
        Me.Label23.TabIndex = 27
        '
        'Label24
        '
        Me.Label24.BackColor = System.Drawing.Color.Blue
        Me.Label24.Location = New System.Drawing.Point(0, 8)
        Me.Label24.Name = "Label24"
        Me.Label24.Size = New System.Drawing.Size(1200, 1)
        Me.Label24.TabIndex = 28
        '
        'Label25
        '
        Me.Label25.BackColor = System.Drawing.Color.Blue
        Me.Label25.Location = New System.Drawing.Point(0, 10)
        Me.Label25.Name = "Label25"
        Me.Label25.Size = New System.Drawing.Size(1200, 1)
        Me.Label25.TabIndex = 29
        '
        'Label26
        '
        Me.Label26.BackColor = System.Drawing.Color.Blue
        Me.Label26.Location = New System.Drawing.Point(0, 12)
        Me.Label26.Name = "Label26"
        Me.Label26.Size = New System.Drawing.Size(1200, 1)
        Me.Label26.TabIndex = 30
        '
        'Label27
        '
        Me.Label27.BackColor = System.Drawing.Color.Blue
        Me.Label27.Location = New System.Drawing.Point(0, 14)
        Me.Label27.Name = "Label27"
        Me.Label27.Size = New System.Drawing.Size(1200, 1)
        Me.Label27.TabIndex = 31
        '
        'Label28
        '
        Me.Label28.BackColor = System.Drawing.Color.Blue
        Me.Label28.Location = New System.Drawing.Point(0, 16)
        Me.Label28.Name = "Label28"
        Me.Label28.Size = New System.Drawing.Size(1200, 1)
        Me.Label28.TabIndex = 32
        '
        'Label29
        '
        Me.Label29.BackColor = System.Drawing.Color.White
        Me.Label29.Location = New System.Drawing.Point(0, 18)
        Me.Label29.Name = "Label29"
        Me.Label29.Size = New System.Drawing.Size(1200, 1)
        Me.Label29.TabIndex = 33
        '
        'Button4
        '
        Me.Button4.BackColor = System.Drawing.Color.Gray
        Me.Button4.Cursor = System.Windows.Forms.Cursors.Arrow
        Me.Button4.FlatStyle = System.Windows.Forms.FlatStyle.Popup
        Me.Button4.Font = New System.Drawing.Font("Microsoft Sans Serif", 27.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Button4.ForeColor = System.Drawing.Color.White
        Me.Button4.Location = New System.Drawing.Point(520, 240)
        Me.Button4.Name = "Button4"
        Me.Button4.Size = New System.Drawing.Size(80, 64)
        Me.Button4.TabIndex = 34
        Me.Button4.Text = "1"
        '
        'Button5
        '
        Me.Button5.BackColor = System.Drawing.Color.Gray
        Me.Button5.Cursor = System.Windows.Forms.Cursors.Arrow
        Me.Button5.FlatStyle = System.Windows.Forms.FlatStyle.Popup
        Me.Button5.Font = New System.Drawing.Font("Microsoft Sans Serif", 27.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Button5.ForeColor = System.Drawing.Color.White
        Me.Button5.Location = New System.Drawing.Point(520, 320)
        Me.Button5.Name = "Button5"
        Me.Button5.Size = New System.Drawing.Size(80, 64)
        Me.Button5.TabIndex = 35
        Me.Button5.Text = "2"
        '
        'Label9
        '
        Me.Label9.BackColor = System.Drawing.Color.Black
        Me.Label9.Cursor = System.Windows.Forms.Cursors.No
        Me.Label9.Font = New System.Drawing.Font("Microsoft Sans Serif", 21.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label9.ForeColor = System.Drawing.Color.White
        Me.Label9.Location = New System.Drawing.Point(24, 448)
        Me.Label9.Name = "Label9"
        Me.Label9.Size = New System.Drawing.Size(992, 32)
        Me.Label9.TabIndex = 36
        Me.Label9.Text = "Press key 1 to send asci 1 (0x31) to the coverter"
        '
        'Label10
        '
        Me.Label10.BackColor = System.Drawing.Color.Black
        Me.Label10.Cursor = System.Windows.Forms.Cursors.No
        Me.Label10.Font = New System.Drawing.Font("Microsoft Sans Serif", 21.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label10.ForeColor = System.Drawing.Color.White
        Me.Label10.Location = New System.Drawing.Point(24, 488)
        Me.Label10.Name = "Label10"
        Me.Label10.Size = New System.Drawing.Size(992, 32)
        Me.Label10.TabIndex = 37
        Me.Label10.Text = "Press key 2 to send asci 2 (0x32) to the coverter"
        '
        'Label15
        '
        Me.Label15.BackColor = System.Drawing.Color.Black
        Me.Label15.Cursor = System.Windows.Forms.Cursors.No
        Me.Label15.Font = New System.Drawing.Font("Microsoft Sans Serif", 21.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label15.ForeColor = System.Drawing.Color.White
        Me.Label15.Location = New System.Drawing.Point(24, 528)
        Me.Label15.Name = "Label15"
        Me.Label15.Size = New System.Drawing.Size(992, 32)
        Me.Label15.TabIndex = 38
        Me.Label15.Text = "Press key L to send asci L (0x4c) to the coverter"
        '
        'Label16
        '
        Me.Label16.BackColor = System.Drawing.Color.Black
        Me.Label16.Cursor = System.Windows.Forms.Cursors.No
        Me.Label16.Font = New System.Drawing.Font("Microsoft Sans Serif", 21.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label16.ForeColor = System.Drawing.Color.White
        Me.Label16.Location = New System.Drawing.Point(24, 568)
        Me.Label16.Name = "Label16"
        Me.Label16.Size = New System.Drawing.Size(992, 32)
        Me.Label16.TabIndex = 39
        Me.Label16.Text = "Press key l  to send asci l  (0x6c) to the coverter"
        '
        'Label17
        '
        Me.Label17.BackColor = System.Drawing.Color.Black
        Me.Label17.Cursor = System.Windows.Forms.Cursors.No
        Me.Label17.Font = New System.Drawing.Font("Microsoft Sans Serif", 21.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label17.ForeColor = System.Drawing.Color.White
        Me.Label17.Location = New System.Drawing.Point(24, 608)
        Me.Label17.Name = "Label17"
        Me.Label17.Size = New System.Drawing.Size(992, 32)
        Me.Label17.TabIndex = 40
        Me.Label17.Text = "Press keyU to send asci U (0x55) to the coverter"
        '
        'Label18
        '
        Me.Label18.BackColor = System.Drawing.Color.Black
        Me.Label18.Cursor = System.Windows.Forms.Cursors.No
        Me.Label18.Font = New System.Drawing.Font("Microsoft Sans Serif", 21.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label18.ForeColor = System.Drawing.Color.White
        Me.Label18.Location = New System.Drawing.Point(24, 648)
        Me.Label18.Name = "Label18"
        Me.Label18.Size = New System.Drawing.Size(992, 32)
        Me.Label18.TabIndex = 41
        Me.Label18.Text = "All these are followed by 0x0d and 0x0a"
        '
        'Label19
        '
        Me.Label19.Font = New System.Drawing.Font("Microsoft Sans Serif", 21.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label19.ForeColor = System.Drawing.Color.OrangeRed
        Me.Label19.Location = New System.Drawing.Point(24, 400)
        Me.Label19.Name = "Label19"
        Me.Label19.Size = New System.Drawing.Size(992, 32)
        Me.Label19.TabIndex = 42
        Me.Label19.Text = "Demo Prog   use as a sample"
        '
        'Button8
        '
        Me.Button8.BackColor = System.Drawing.Color.DimGray
        Me.Button8.Cursor = System.Windows.Forms.Cursors.Arrow
        Me.Button8.Font = New System.Drawing.Font("Microsoft Sans Serif", 18.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Button8.ForeColor = System.Drawing.Color.Yellow
        Me.Button8.Location = New System.Drawing.Point(616, 320)
        Me.Button8.Name = "Button8"
        Me.Button8.Size = New System.Drawing.Size(88, 64)
        Me.Button8.TabIndex = 45
        Me.Button8.Text = "9600  Baud"
        '
        'Button9
        '
        Me.Button9.BackColor = System.Drawing.Color.DimGray
        Me.Button9.Cursor = System.Windows.Forms.Cursors.Arrow
        Me.Button9.Font = New System.Drawing.Font("Microsoft Sans Serif", 18.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Button9.ForeColor = System.Drawing.Color.DarkGray
        Me.Button9.Location = New System.Drawing.Point(616, 240)
        Me.Button9.Name = "Button9"
        Me.Button9.Size = New System.Drawing.Size(88, 64)
        Me.Button9.TabIndex = 46
        Me.Button9.Text = "1200 Baud"
        '
        'Label20
        '
        Me.Label20.BackColor = System.Drawing.Color.Gray
        Me.Label20.Location = New System.Drawing.Point(744, 216)
        Me.Label20.Name = "Label20"
        Me.Label20.Size = New System.Drawing.Size(256, 480)
        Me.Label20.TabIndex = 47
        '
        'Label30
        '
        Me.Label30.Image = CType(resources.GetObject("Label30.Image"), System.Drawing.Bitmap)
        Me.Label30.Location = New System.Drawing.Point(760, 232)
        Me.Label30.Name = "Label30"
        Me.Label30.Size = New System.Drawing.Size(224, 448)
        Me.Label30.TabIndex = 48
        '
        'Form1
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.BackColor = System.Drawing.Color.Black
        Me.CancelButton = Me.Button0
        Me.ClientSize = New System.Drawing.Size(1016, 746)
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Label30, Me.Label20, Me.Button9, Me.Button8, Me.Label19, Me.Label18, Me.Label17, Me.Label16, Me.Label15, Me.Label10, Me.Label9, Me.Button5, Me.Button4, Me.Label29, Me.Label28, Me.Label27, Me.Label26, Me.Label25, Me.Label24, Me.Label23, Me.Label22, Me.Label21, Me.Button3, Me.Button0, Me.TextBox1, Me.Label13, Me.Label12, Me.Label11, Me.Button1, Me.Label8, Me.Label7, Me.Label6, Me.Label5, Me.Label4, Me.Label3, Me.Label2, Me.Label1, Me.Button2, Me.Label14})
        Me.Cursor = System.Windows.Forms.Cursors.No
        Me.Name = "Form1"
        Me.Text = "VGA to Serial OUT"
        Me.TopMost = True
        Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
        Me.ResumeLayout(False)

    End Sub

#End Region


    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        TopMost = True
        Me.TextBox1.Focus()                 'keep focus on keyboard
    End Sub

    '**************************************************************************
    'the first line on the screen after the title bar is line 0 this is left black 
    'the next line 1 is also left black these are the low before the first clock pulse
    'the next line 2 this is always on as this is the clock pulse for bit 1 of the 8 bit byte
    'line 3 is label 1 it is the first of the data bits black is zero and blue is one
    'line 4 is a clock pulse for the second bit so is always on ie blue
    'line 5 is label 2 it is the second of the data bits black is zero and blue is one
    'line 6 is a clock pulse for the second bit so is always on ie blue
    'line 7 is label 3 it is the third of the data bits black is zero and blue is one
    'line 8 is a clock pulse for the second bit so is always on ie blue
    'line 8 is label 4 it is the fourth of the data bits black is zero and blue is one
    'line 9 is a clock pulse for the second bit so is always on ie blue
    'line 10 is label 5 it is the fifth of the data bits black is zero and blue is one
    'line 11 is a clock pulse for the second bit so is always on ie blue
    'line 12 is label 6 it is the sixth of the data bits black is zero and blue is one
    'line 13 is a clock pulse for the second bit so is always on ie blue
    'line 14 is label 7 it is the seventh of the data bits black is zero and blue is one
    'line 15 is a clock pulse for the second bit so is always on ie blue
    'line 16 is label 8 it is the last of the data bits black is zero and blue is one
    'line 17 is a stop clock pulse

    'the rest of the screen can have any colors
    '*THE SCREEN SHOULD BE MAXIMISED TO WORK AS THE COLOR AND POSITION ARE WHAT IS READ*

    '************************************************************************

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
        'These keys are a sample of the keys and codes that can be used 
        'You can also use a wifi keyboard or an android app
        'I use either app "PC remote"  or "vectir"  both work realy well
        '"PC remote" shows the live pc screen on a smart phone 
        '"vectir" you create your own keypad and graphics for the phone 

        '***CONVERT A KEY PRESS TO A 3 BYTE CODE YOU CAN MAKE UP YOUR OWN CODES*******
        If (TextBox1.Text = "1") Then           'if key 1 was pressed
            code1 = "00110001"                  '1st code to be sent 0x31 asci 1
            code2 = "00001101"                  '2nd code   0x0d carrage return
            code3 = "00001010"                  '3rd code   0x0a line feed
            Me.Label12.Text = "1"
            Me.Label13.Text = "Serial 1"        'display the controled equipment
            Me.Timer1.Enabled = True            'timer 1 sends codes to screen and vga port
        End If
        If (TextBox1.Text = "2") Then
            code1 = "00110010"                  '1st code to be sent 0x32 asci 2
            code2 = "00001101"                  '2nd code   0x0d carrage return
            code3 = "00001010"                  '3rd code   0x0a line feed
            Me.Label12.Text = "2"
            Me.Label13.Text = "Serial 2"
            Me.Timer1.Enabled = True
        End If

        If (TextBox1.Text = "L") Then
            code1 = "01001100"                  '1st code to be sent 0x4c asci L
            code2 = "00001101"                  '2nd code   0x0d carrage return
            code3 = "00001010"                  '3rd code   0x0a line feed
            Me.Label12.Text = "L"
            Me.Label13.Text = "Lounge ON"
            Me.Timer1.Enabled = True
        End If

        If (TextBox1.Text = "l") Then
            code1 = "01101100"                  '1st code to be sent 0x6c asci l
            code2 = "00001101"                  '2nd code   0x0d carrage return
            code3 = "00001010"                  '3rd code   0x0a line feed
            Me.Label12.Text = "l"
            Me.Label13.Text = "Lounge OFF"
            Me.Timer1.Enabled = True
        End If

        'in my system this code is sent to an RF to IR converter to adjust volume on sound system
        If (TextBox1.Text = "U") Then
            code1 = "01010101"                  '1st code to be sent 0x55 asci U
            code2 = "00001101"                  '2nd code   0x0d carrage return
            code3 = "00001010"                  '3rd code   0x0a line feed
            Me.Label12.Text = "U"
            Me.Label13.Text = "Volume UP"
            Me.Timer1.Enabled = True
        End If

        '*****************
        'expand to the full key board and any combination of codes exept 0xff and 0xfd 
        'AS THESE ARE RESERVED FOR THE START BYTE  oxff=9600 Baud & 0xfd=1200 Baud
        '*****************

        '************************************
        Me.TextBox1.Text = ""               'clear the pressed key 
        Me.TextBox1.Focus()                 'keep focus on keyboard
    End Sub


    '***************TIMER 1 SENDS DATA BY ENCODING THE TOP 16 LINES OF SCREEN*****
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Me.Timer2.Enabled = False
        count = count + 1
        If (count = 1) Then code = start 'start is 0xff for 9600 Baud or 0xfd=1200 Baud set by buttons 8 & 9
        If (count = 2) Then code = code1 '1st user code to send
        If (count = 3) Then code = start 'start is 0xff for 9600 Baud or 0xfd=1200 Baud set by buttons 8 & 9
        If (count = 4) Then code = code2 '2nd user code to send
        If (count = 6) Then code = start 'start is 0xff for 9600 Baud or 0xfd=1200 Baud set by buttons 8 & 9
        If (count = 7) Then code = code3 '3rd user code to send
        If (count = 8) Then             'all codes are now sent so
            Me.Timer1.Enabled = False   'turn off timer
            code = finish               'send last 0x00 to leave the screen port black
            count = 0                   'reset count to zero
            Me.TextBox1.Text = ""
            Me.TextBox1.Focus()
            Me.Timer2.Enabled = True
        End If

        'these 8 labels are the 8 lines on the sceeen top that represent the 8 bits of a byte 
        If (Mid(code, 1, 1) = 1) Then   'if the first digit of the code is 1 then turn on blue gun
            Me.Label1.BackColor = System.Drawing.Color.Blue
        Else
            Me.Label1.BackColor = System.Drawing.Color.Black    'if 1st digit is zero go black
        End If
        If (Mid(code, 2, 1) = 1) Then   'if the second digit of the code is 1 then turn on blue gun
            Me.Label2.BackColor = System.Drawing.Color.Blue
        Else
            Me.Label2.BackColor = System.Drawing.Color.Black
        End If
        If (Mid(code, 3, 1) = 1) Then
            Me.Label3.BackColor = System.Drawing.Color.Blue
        Else
            Me.Label3.BackColor = System.Drawing.Color.Black
        End If
        If (Mid(code, 4, 1) = 1) Then
            Me.Label4.BackColor = System.Drawing.Color.Blue
        Else
            Me.Label4.BackColor = System.Drawing.Color.Black
        End If
        If (Mid(code, 5, 1) = 1) Then
            Me.Label5.BackColor = System.Drawing.Color.Blue
        Else
            Me.Label5.BackColor = System.Drawing.Color.Black
        End If
        If (Mid(code, 6, 1) = 1) Then
            Me.Label6.BackColor = System.Drawing.Color.Blue
        Else
            Me.Label6.BackColor = System.Drawing.Color.Black
        End If
        If (Mid(code, 7, 1) = 1) Then
            Me.Label7.BackColor = System.Drawing.Color.Blue
        Else
            Me.Label7.BackColor = System.Drawing.Color.Black
        End If
        If (Mid(code, 8, 1) = 1) Then
            Me.Label8.BackColor = System.Drawing.Color.Blue
        Else
            Me.Label8.BackColor = System.Drawing.Color.Black
        End If
        ''        Me.TextBox1.Text = ""
        ''      Me.TextBox1.Focus()
    End Sub

    '*******************TIMER 2 IS THE NOW TIME THAT CAN BE USED TO TURN LIGHTS ON AND OFF AT SET TIMES*****
    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
        Me.Label11.Text = TimeOfDay     'the clock
    End Sub



    Private Sub Button0_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button0.Click
        End
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.TextBox1.Text = "L"
    End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Me.TextBox1.Text = "l"
    End Sub
    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Me.TextBox1.Text = "U"
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        Me.TextBox1.Text = "1"
    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        Me.TextBox1.Text = "2"
    End Sub

    Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
        start = "11111111"     ''if the start code is 0xff the converter sends 9600 Baud
        Me.Button9.ForeColor = System.Drawing.Color.DarkGray
        Me.Button8.ForeColor = System.Drawing.Color.Yellow
        Me.TextBox1.Focus()
    End Sub

    Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
        start = "11111101"     ''if the start code is 0xfd the converter sends a slower 1200 Baud
        Me.Button8.ForeColor = System.Drawing.Color.DarkGray
        Me.Button9.ForeColor = System.Drawing.Color.Yellow
        Me.TextBox1.Focus()
    End Sub

    Private Sub Label30_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label30.Click

    End Sub
End Class
