BASIC4PPC  COMPILER
PROGRAM  EXAMPLE:


Bluetooth  Serial  Port
Transmit  and  Receive
This program example will show you how transmit data
to and receive data from a microcontroller across a wireless bluetooth serial port connection using an embedded bluetooth hardware module.
The Pocket PC used in this example is an HP IPAQ H2210 PDA with:

     64 MB of system RAM
     32 MB of system flash ROM  ( Dated: 5/22/2003 )
     OS Version:  Windows CE 4.20
     Display Resolution:  240 horizontal pixels  by  320 vertical pixels
     Processor Type:  Intel PXA255
     Bluetooth
     1 SDIO Card Slot
     1 Compact Flash Card Slot
     Headset / Microphone Jack

This HP H2210 PDA was manufactured in 2003.  Any of the newer Pocket PCs with Bluetooth capability running the latest version of the Basic4ppc Compiler should be able to run this simple program example.

The embedded bluetooth hardware module used in this example is a BlueSmiRF module.  You can search the Internet and find a variety of embedded bluetooth module boards and fully packaged
plug-and-go bluetooth dongles.

The microcontroller used in this example is the: Athena.  The Athena micro is a PIC microcontroller that is pre-programmed with a BASIC Interpreter.  The Athena can be programmed easily in BASIC using the IDE software written to run on a Windows compatible desktop PC or laptop.
Sub Globals
    ULfLAG=1
    portflag = 0
    strlabel0="COM 8: 9600,N,8,1"
    strlabel1=" [OFF]"
    strlabel2=" [ ON]"
    strlabel3=" : "
    strlabeltemp=""
End Sub

Sub App_Start
    Form1.show
    textbox1.Text=""
    textbox2.Text=""
    label1.Text = strlabel0 & strlabel1 & strlabel3
    strlabeltemp  = strlabel0 & strlabel1 & strlabel3
     
    serial.New2 (8,9600,"N",8,1)

    textbox1.FontSize=9
    textbox2.FontSize=9

    Sip=false
End Sub

Sub OPENPORT_Click
If portflag = 0 Then
   serial.PortOpen=true
   portflag = 1
   label1.Text = strlabel0 & strlabel2 & strlabel3
   strlabeltemp=label1.Text
   serial.enableoncomm=true
   serial.Output ("*")
End If
End Sub

Sub CLOSEPORT_Click
If portflag = 1 Then
   TextBox1.Text=""
   serial.Output ("^")
   serial.enableoncomm=false
   serial.PortOpen=false
   portflag = 0
   label1.Text = strlabel0 & strlabel1 & strlabel3
   strlabeltemp=label1.Text
End If
End Sub

Sub serial_OnCom
    TextBox2.Text=TextBox2.Text & serial.Inputstring
End Sub

Sub ButtonA_Click
If ULflag=0 Then
   serial.Output ("a")
   label1.Text = strlabeltemp & "a"
End If
If ULflag=1 Then
   serial.Output ("A")
   label1.Text = strlabeltemp & "A"
End If
End Sub

Sub ButtonB_Click
If ULflag=0 Then
   serial.Output ("b")
   label1.Text = strlabeltemp & "b"
End If
If ULflag=1 Then
   serial.Output ("B")
   label1.Text = strlabeltemp & "B"
End If
End Sub

Sub ButtonC_Click
If ULflag=0 Then
   serial.Output ("c")
   label1.Text = strlabeltemp & "c"
End If
If ULflag=1 Then
   serial.Output ("C")
   label1.Text = strlabeltemp & "C"
End If
End Sub

Sub ButtonD_Click
If ULflag=0 Then
   serial.Output ("d")
   label1.Text = strlabeltemp & "d"
End If
If ULflag=1 Then
   serial.Output ("D")
   label1.Text = strlabeltemp & "D"
End If
End Sub

Sub ButtonE_Click
If ULflag=0 Then
   serial.Output ("e")
   label1.Text = strlabeltemp & "e"
End If
If ULflag=1 Then
   serial.Output ("E")
   label1.Text = strlabeltemp & "E"
End If
End Sub

Sub ButtonF_Click
If ULflag=0 Then
   serial.Output ("f")
   label1.Text = strlabeltemp & "f"
End If
If ULflag=1 Then
   serial.Output ("F")
   label1.Text = strlabeltemp & "F"
End If
End Sub

Sub ButtonG_Click
If ULflag=0 Then
   serial.Output ("g")
   label1.Text = strlabeltemp & "g"
End If
If ULflag=1 Then
   serial.Output ("G")
   label1.Text = strlabeltemp & "G"
End If
End Sub

Sub ButtonH_Click
If ULflag=0 Then
   serial.Output ("h")
   label1.Text = strlabeltemp & "h"
End If
If ULflag=1 Then
   serial.Output ("H")
   label1.Text = strlabeltemp & "H"
End If
End Sub

Sub ButtonI_Click
If ULflag=0 Then
   serial.Output ("i")
   label1.Text = strlabeltemp & "i"
End If
If ULflag=1 Then
   serial.Output ("I")
   label1.Text = strlabeltemp & "I"
End If
End Sub

Sub ButtonJ_Click
If ULflag=0 Then
   serial.Output ("j")
   label1.Text = strlabeltemp & "j"
End If
If ULflag=1 Then
   serial.Output ("J")
   label1.Text = strlabeltemp & "J"
End If
End Sub

Sub ButtonK_Click
If ULflag=0 Then
   serial.Output ("k")
   label1.Text = strlabeltemp & "k"
End If
If ULflag=1 Then
   serial.Output ("K")
   label1.Text = strlabeltemp & "K"
End If
End Sub

Sub ButtonL_Click
If ULflag=0 Then
   serial.Output ("l")
   label1.Text = strlabeltemp & "l"
End If
If ULflag=1 Then
   serial.Output ("L")
   label1.Text = strlabeltemp & "L"
End If
End Sub

Sub ButtonM_Click
If ULflag=0 Then
   serial.Output ("m")
   label1.Text = strlabeltemp & "m"
End If
If ULflag=1 Then
   serial.Output ("M")
   label1.Text = strlabeltemp & "M"
End If
End Sub

Sub ButtonN_Click
If ULflag=0 Then
   serial.Output ("n")
   label1.Text = strlabeltemp & "n"
End If
If ULflag=1 Then
   serial.Output ("N")
   label1.Text = strlabeltemp & "N"
End If
End Sub

Sub ButtonO_Click
If ULflag=0 Then
   serial.Output ("o")
   label1.Text = strlabeltemp & "o"
End If
If ULflag=1 Then
   serial.Output ("O")
   label1.Text = strlabeltemp & "O"
End If
End Sub

Sub ButtonP_Click
If ULflag=0 Then
   serial.Output ("p")
   label1.Text = strlabeltemp & "p"
End If
If ULflag=1 Then
   serial.Output ("P")
   label1.Text = strlabeltemp & "P"
End If
End Sub

Sub ButtonQ_Click
If ULflag=0 Then
   serial.Output ("q")
   label1.Text = strlabeltemp & "q"
End If
If ULflag=1 Then
   serial.Output ("Q")
   label1.Text = strlabeltemp & "Q"
End If
End Sub

Sub ButtonR_Click
 If ULflag=0 Then
   serial.Output ("r")
   label1.Text = strlabeltemp & "r"
End If
If ULflag=1 Then
   serial.Output ("R")
   label1.Text = strlabeltemp & "R"
End If
End Sub

Sub ButtonS_Click
If ULflag=0 Then
   serial.Output ("s")
   label1.Text = strlabeltemp & "s"
End If
If ULflag=1 Then
   serial.Output ("S")
   label1.Text = strlabeltemp & "S"
End If
End Sub

Sub ButtonT_Click
If ULflag=0 Then
   serial.Output ("t")
   label1.Text = strlabeltemp & "t"
End If
If ULflag=1 Then
   serial.Output ("T")
   label1.Text = strlabeltemp & "T"
End If
End Sub

Sub ButtonU_Click
If ULflag=0 Then
   serial.Output ("u")
   label1.Text = strlabeltemp & "u"
End If
If ULflag=1 Then
   serial.Output ("U")
   label1.Text = strlabeltemp & "U"
End If
End Sub

Sub ButtonV_Click
If ULflag=0 Then
   serial.Output ("v")
   label1.Text = strlabeltemp & "v"
End If
If ULflag=1 Then
   serial.Output ("V")
   label1.Text = strlabeltemp & "V"
End If
End Sub

Sub ButtonW_Click
If ULflag=0 Then
   serial.Output ("w")
   label1.Text = strlabeltemp & "w"
End If
If ULflag=1 Then
   serial.Output ("W")
   label1.Text = strlabeltemp & "W"
End If
End Sub

Sub ButtonX_Click
If ULflag=0 Then
   serial.Output ("x")
   label1.Text = strlabeltemp & "x"
End If
If ULflag=1 Then
   serial.Output ("X")
   label1.Text = strlabeltemp & "X"
End If
End Sub

Sub ButtonY_Click
If ULflag=0 Then
   serial.Output ("y")
   label1.Text = strlabeltemp & "y"
End If
If ULflag=1 Then
   serial.Output ("Y")
   label1.Text = strlabeltemp & "Y"
End If
End Sub

Sub ButtonZ_Click
If ULflag=0 Then
   serial.Output ("z")
   label1.Text = strlabeltemp & "z"
End If
If ULflag=1 Then
   serial.Output ("Z")
   label1.Text = strlabeltemp & "Z"
End If
End Sub

Sub Button0_Click
  serial.Output ("0")
  label1.Text = strlabeltemp & "0"
End Sub

Sub Button1_Click
  serial.Output ("1")
  label1.Text = strlabeltemp & "1"
End Sub

Sub Button2_Click
  serial.Output ("2")
  label1.Text = strlabeltemp & "2"
End Sub

Sub Button3_Click
  serial.Output ("3")
  label1.Text = strlabeltemp & "3"
End Sub

Sub Button4_Click
  serial.Output ("4")
  label1.Text = strlabeltemp & "4"
End Sub

Sub Button5_Click
  serial.Output ("5")
  label1.Text = strlabeltemp & "5"
End Sub

Sub Button6_Click
  serial.Output ("6")
  label1.Text = strlabeltemp & "6"
End Sub

Sub Button7_Click
  serial.Output ("7")
  label1.Text = strlabeltemp & "7"
End Sub

Sub Button8_Click
  serial.Output ("8")
  label1.Text = strlabeltemp & "8"
End Sub

Sub Button9_Click
  serial.Output ("9")
  label1.Text = strlabeltemp & "9"
End Sub

Sub UPPER_Click
    ULflag=1
    buttonA.Text="A"
    buttonB.Text="B"
    buttonC.Text="C"
    buttonD.Text="D"
    buttonE.Text="E"
    buttonF.Text="F"
    buttonG.Text="G"
    buttonH.Text="H"
    buttonI.Text="I"
    buttonJ.Text="J"
    buttonK.Text="K"
    buttonL.Text="L"
    buttonM.Text="M"
    buttonN.Text="N"
    buttonO.Text="O"
    buttonP.Text="P"
    buttonQ.Text="Q"
    buttonR.Text="R"
    buttonS.Text="S"
    buttonT.Text="T"
    buttonU.Text="U"
    buttonV.Text="V"
    buttonW.Text="W"
    buttonX.Text="X"
    buttonY.Text="Y"
    buttonZ.Text="Z"
End Sub

Sub LOWER_Click
    ULflag=0
    buttonA.Text="a"
    buttonB.Text="b"
    buttonC.Text="c"
    buttonD.Text="d"
    buttonE.Text="e"
    buttonF.Text="f"
    buttonG.Text="g"
    buttonH.Text="h"
    buttonI.Text="i"
    buttonJ.Text="j"
    buttonK.Text="k"
    buttonL.Text="l"
    buttonM.Text="m"
    buttonN.Text="n"
    buttonO.Text="o"
    buttonP.Text="p"
    buttonQ.Text="q"
    buttonR.Text="r"
    buttonS.Text="s"
    buttonT.Text="t"
    buttonU.Text="u"
    buttonV.Text="v"
    buttonW.Text="w"
    buttonX.Text="x"
    buttonY.Text="y"
    buttonZ.Text="z"
End Sub

Sub CLEARTX_Click
    textbox1.Text=""
    label1.Text = strlabeltemp
End Sub

Sub CLEARRX_Click
    textbox2.Text=""
    label1.Text = strlabeltemp
End Sub

Sub SENDSTRING_Click
    serial.Output (textbox1.Text)
End Sub

Sub SpButton1_Click
    serial.Output ("!")
    label1.Text = strlabeltemp & "!"
End Sub

Sub SpButton2_Click
    serial.Output ("@")
    label1.Text = strlabeltemp & "@"
End Sub

Sub SpButton3_Click
    serial.Output ("#")
    label1.Text = strlabeltemp & "#"
End Sub

Sub SpButton4_Click
    serial.Output ("$")
    label1.Text = strlabeltemp & "$"
End Sub

Sub SpButton5_Click
    serial.Output ("%")
    label1.Text = strlabeltemp & "%"
End Sub

Sub SpButton6_Click
    serial.Output ("^")
    label1.Text = strlabeltemp & "^"
End Sub

Sub SpButton7_Click
    serial.Output ("=")
    label1.Text = strlabeltemp & "="
End Sub

Sub SpButton8_Click
    serial.Output ("*")
    label1.Text = strlabeltemp & "*"
End Sub

Sub SpButton9_Click
    serial.Output ("(")
    label1.Text = strlabeltemp & "("
End Sub

Sub SpButton10_Click
    serial.Output (")")
    label1.Text = strlabeltemp & ")"
End Sub

Sub SpButton11_Click
    serial.Output ("\")
    label1.Text = strlabeltemp & "\"
End Sub

Sub SpButton12_Click
    serial.Output ("/")
    label1.Text = strlabeltemp & "/"
End Sub

Sub SpButton13_Click
    serial.Output (";")
    label1.Text = strlabeltemp & ";"
End Sub

Sub SpButton14_Click
    serial.Output ("-")
    label1.Text = strlabeltemp & "-"
End Sub

Sub SpButton15_Click
    serial.Output ("|")
    label1.Text = strlabeltemp & "|"
End Sub

Sub SpButton16_Click
    serial.Output (",")
    label1.Text = strlabeltemp & ","
End Sub

Sub SpButton17_Click
    serial.Output ("<")
    label1.Text = strlabeltemp & "<"
End Sub

Sub SpButton18_Click
    serial.Output (">")
    label1.Text = strlabeltemp & ">"
End Sub

Sub SpButton19_Click
    serial.Output ("?")
    label1.Text = strlabeltemp & "?"
End Sub

Sub SpButton20_Click
    serial.Output ("~")
    label1.Text = strlabeltemp & "~"
End Sub

Sub SpButton21_Click
    serial.Output ("{")
    label1.Text = strlabeltemp & "{"
End Sub

Sub SpButton22_Click
    serial.Output ("}")
    label1.Text = strlabeltemp & "}"
End Sub

Sub SpButton23_Click
    serial.Output ("[")
    label1.Text = strlabeltemp & "["
End Sub

Sub SpButton24_Click
    serial.Output ("]")
    label1.Text = strlabeltemp & "]"
End Sub
BASIC4PPC PROGRAM CODE LISTING : NO COMMENTS.
We need some way to send a wide variety of ASCII characters and character strings to a microcontroller so that we can test our embedded hardware designs.  In this example we
create a BASIC4PPC software application for the Pocket PC that can send just about any
ASCII character that we choose across a Bluetooth serial port link to a microcontroller.
By using such a program, we can experiment with a large number of ASCII character
"Commands" that can be processed by a microcontroller to perform a large number of
different functions.

This program allows us to send individual ASCII characters by pressing a button or
we can create ASCII character strings of any length that can be transmitted.  The TX
textbox window is used to create ASCII character strings by using the Pocket PC's
Soft Input Panel keyboard.  Once the string has been created we can send it by pressing
the "Send TX" button.  The "Send TX" button will transmit the character string that it
finds in the TX textbox window.

The RX textbox window will display all ASCII characters that is received by the Pocket
PC across the Bluetooth wireless link.  The Pocket PC can send ASCII characters to a
microcontrollers across the Bluetooth wireless link and a microcontroller can send
ASCII characters to the Pocket PC across the Bluetooth wireless link.

By connecting the TX line up to the RX line on the BlueSMiRF module, we can loop back
all of the characters that the BlueSMiRF receives from the Pocket PC and send these
characters back to the Pocket PC where they will be displayed in the RX textbox window.

This "loop back" configuration can be used to verify that the BASIC4PPC application is
sending the right ASCII character or string of characters to the microcontroller.
BlueSMiRF Bluetooth Module Configured in Loop Back Mode.
BASIC4PPC PROGRAM CODE LISTING : WITH COMMENTS.
Sub Globals

'The variable ULfLAG is used to select UPPER case or
'LOWER case alphabetic characters.


    ULfLAG=1

'The variable portflag is used to control how many times
'the Open Port button code has been executed.  The
'Open Port button must be pressed one time to open the
'Bluetooth serial communications port and then the
'Close Port button must be pressed to close the Bluetooth
'serial communications port.  If we try to execute the
'code for the Open Port button multiple times in a row
'it will lock up the Pocket PC PDA and we have to Reset
'the PDA to recover.  The variable portflag is used to
'execute the Open Port button code only one time to
'avoid locking up the PDA.


    portflag = 0

'The strlabel variables 0,1,2,3 and strlabeltemp are used
'to display the status of the Bluetooth serial communications
'port and the ASCII characters that have been transmitted
'by the PDA to the Bluesmirf Bluetooth module.


    strlabel0="COM 8: 9600,N,8,1"
    strlabel1=" [OFF]"
    strlabel2=" [ ON]"
    strlabel3=" : "
    strlabeltemp=""


End Sub

Sub App_Start


'Show the software applications main form.

    Form1.show

'Clear the contents of the Transmit and Receive
'TextBox windows.


    textbox1.Text=""
    textbox2.Text=""


'Create the status label displayed at the top of the form.
'Save the most recent state of the status label in the
'variable strlabeltemp so it can be used the next time
'the status label is updated.


    label1.Text = strlabel0 & strlabel1 & strlabel3
    strlabeltemp  = strlabel0 & strlabel1 & strlabel3


'Initialize the Pocket PC serial communications port.
     

    serial.New2 (8,9600,"N",8,1)

'Set the font size for the Transmit and Receive
'TextBox windows.


    textbox1.FontSize=9
    textbox2.FontSize=9


'Turn the Soft Input Panel Keyboard OFF.

    Sip=false

End Sub


'This subroutine opens the Bluetooth serial port
'connection on the Pocket PC.  The portflag variable
'is checked first to see if the wireless serial port
'connection has already been opened.  If it has then
'the portflag variable will have been set equal to 1 and
'the code section which opens the Bluetooth serial port
'will not be executed again.  If the portflag variable is
'equal to 0, the Bluetooth serial port connection
'has not been opened yet and the code inside the
'If ... Then statement will be executed.  The serial port
'is opened, the portflag variable is set equal to 1, the
'status label at the top the form is updated, the reception
'of serial port data is enabled and the ASCII character *
'is transmitted to the Athena microcontroller.
'The Bluetooth serial port connection must be opened
'only once and then it must be shut down.  If we tried
'to open the Bluetooth serial port connection multiple
'times before shutting it down it will lock up the Pocket
'PC and force a hard reset to recover.  The portflag
'variable allows us to keep track by telling us if the
'Bluetooth serial port has already been opened or not.


Sub OPENPORT_Click
If portflag = 0 Then
   serial.PortOpen=true
   portflag = 1
   label1.Text = strlabel0 & strlabel2 & strlabel3
   strlabeltemp=label1.Text
   serial.enableoncomm=true
   serial.Output ("*")
End If
End Sub


'This subroutine will close the Bluetooth serial port
'connection.  The portflag variable is checked to see
'if the Bluetooth serial port connection is currently open.
'If portflag = 1 then the serial port connection is open
'and the code in the If ... Then statement will be
'executed to shut the serial port connection down.
'The Transmit and Receive TextBox windows are
'cleared of any characters, the ASCII character ^
'is transmitted to the Athena microcontroller,
'serial port reception on the Pocket PC is turned
'off, the serial port connection is closed, the portflag
'variable is set equal to 0 and the status label at the
'top of the form is updated.


Sub CLOSEPORT_Click
If portflag = 1 Then
   TextBox1.Text=""
   TextBox2.Text=""
   serial.Output ("^")
   serial.enableoncomm=false
   serial.PortOpen=false
   portflag = 0
   label1.Text = strlabel0 & strlabel1 & strlabel3
   strlabeltemp=label1.Text
End If
End Sub


'When the Bluetooth serial port connection is turned
'on, this subroutine handles the reception of serial
'port characters received by the Pocket PC.  When
'a character is received it is written to the Receive
'TextBox window.
 

Sub serial_OnCom
    TextBox2.Text=TextBox2.Text & serial.Inputstring
End Sub


'This subroutine handles the transmission of ASCII
'characters: A or a when green ButtonA is pressed
'on the software applications main Form.
'The ULflag determines which ASCII character is
'transmitted out the Pocket PC Bluetooth serial port
'when green ButtonA is pressed.  If ULflag = 0 then
'the lower case ASCII character a will be transmitted.
'If ULflag = 1 then the upper case character A will be
'transmitted.  In either case, upper or lower, the status
'label at the top of the Form will be updated showing
'the ASCII character that has been transmitted.


Sub ButtonA_Click
If ULflag=0 Then
   serial.Output ("a")
   label1.Text = strlabeltemp & "a"
End If
If ULflag=1 Then
   serial.Output ("A")
   label1.Text = strlabeltemp & "A"
End If
End Sub


'This subroutine handles the transmission of ASCII
'characters: B or b when green ButtonB is pressed
'on the software applications main Form.
'The ULflag determines which ASCII character is
'transmitted out the Pocket PC Bluetooth serial port
'when green ButtonB is pressed.  If ULflag = 0 then
'the lower case ASCII character b will be transmitted.
'If ULflag = 1 then the upper case character B will be
'transmitted.  In either case, upper or lower, the status
'label at the top of the Form will be updated showing
'the ASCII character that has been transmitted.


Sub ButtonB_Click
If ULflag=0 Then
   serial.Output ("b")
   label1.Text = strlabeltemp & "b"
End If
If ULflag=1 Then
   serial.Output ("B")
   label1.Text = strlabeltemp & "B"
End If
End Sub


'This subroutine handles the transmission of ASCII
'characters: C or c when green ButtonC is pressed
'on the software applications main Form.
'The ULflag determines which ASCII character is
'transmitted out the Pocket PC Bluetooth serial port
'when green ButtonC is pressed.  If ULflag = 0 then
'the lower case ASCII character c will be transmitted.
'If ULflag = 1 then the upper case character C will be
'transmitted.  In either case, upper or lower, the status
'label at the top of the Form will be updated showing
'the ASCII character that has been transmitted.


Sub ButtonC_Click
If ULflag=0 Then
   serial.Output ("c")
   label1.Text = strlabeltemp & "c"
End If
If ULflag=1 Then
   serial.Output ("C")
   label1.Text = strlabeltemp & "C"
End If
End Sub


'This subroutine handles the transmission of ASCII
'characters: D or d when green ButtonD is pressed
'on the software applications main Form.
'The ULflag determines which ASCII character is
'transmitted out the Pocket PC Bluetooth serial port
'when green ButtonD is pressed.  If ULflag = 0 then
'the lower case ASCII character d will be transmitted.
'If ULflag = 1 then the upper case character D will be
'transmitted.  In either case, upper or lower, the status
'label at the top of the Form will be updated showing
'the ASCII character that has been transmitted.


Sub ButtonD_Click
If ULflag=0 Then
   serial.Output ("d")
   label1.Text = strlabeltemp & "d"
End If
If ULflag=1 Then
   serial.Output ("D")
   label1.Text = strlabeltemp & "D"
End If
End Sub


'This subroutine handles the transmission of ASCII
'characters: E or e when green ButtonE is pressed
'on the software applications main Form.
'The ULflag determines which ASCII character is
'transmitted out the Pocket PC Bluetooth serial port
'when green ButtonE is pressed.  If ULflag = 0 then
'the lower case ASCII character e will be transmitted.
'If ULflag = 1 then the upper case character E will be
'transmitted.  In either case, upper or lower, the status
'label at the top of the Form will be updated showing
'the ASCII character that has been transmitted.


Sub ButtonE_Click
If ULflag=0 Then
   serial.Output ("e")
   label1.Text = strlabeltemp & "e"
End If
If ULflag=1 Then
   serial.Output ("E")
   label1.Text = strlabeltemp & "E"
End If
End Sub


'This subroutine handles the transmission of ASCII
'characters: F or f when green ButtonF is pressed
'on the software applications main Form.
'The ULflag determines which ASCII character is
'transmitted out the Pocket PC Bluetooth serial port
'when green ButtonF is pressed.  If ULflag = 0 then
'the lower case ASCII character f will be transmitted.
'If ULflag = 1 then the upper case character F will be
'transmitted.  In either case, upper or lower, the status
'label at the top of the Form will be updated showing
'the ASCII character that has been transmitted.


Sub ButtonF_Click
If ULflag=0 Then
   serial.Output ("f")
   label1.Text = strlabeltemp & "f"
End If
If ULflag=1 Then
   serial.Output ("F")
   label1.Text = strlabeltemp & "F"
End If
End Sub


'This subroutine handles the transmission of ASCII
'characters: G or g when green ButtonG is pressed
'on the software applications main Form.
'The ULflag determines which ASCII character is
'transmitted out the Pocket PC Bluetooth serial port
'when green ButtonG is pressed.  If ULflag = 0 then
'the lower case ASCII character g will be transmitted.
'If ULflag = 1 then the upper case character G will be
'transmitted.  In either case, upper or lower, the status
'label at the top of the Form will be updated showing
'the ASCII character that has been transmitted.


Sub ButtonG_Click
If ULflag=0 Then
   serial.Output ("g")
   label1.Text = strlabeltemp & "g"
End If
If ULflag=1 Then
   serial.Output ("G")
   label1.Text = strlabeltemp & "G"
End If
End Sub


'This subroutine handles the transmission of ASCII
'characters: H or h when green ButtonH is pressed
'on the software applications main Form.
'The ULflag determines which ASCII character is
'transmitted out the Pocket PC Bluetooth serial port
'when green ButtonH is pressed.  If ULflag = 0 then
'the lower case ASCII character h will be transmitted.
'If ULflag = 1 then the upper case character H will be
'transmitted.  In either case, upper or lower, the status
'label at the top of the Form will be updated showing
'the ASCII character that has been transmitted.


Sub ButtonH_Click
If ULflag=0 Then
   serial.Output ("h")
   label1.Text = strlabeltemp & "h"
End If
If ULflag=1 Then
   serial.Output ("H")
   label1.Text = strlabeltemp & "H"
End If
End Sub


'This subroutine handles the transmission of ASCII
'characters: I or i when green ButtonI is pressed
'on the software applications main Form.
'The ULflag determines which ASCII character is
'transmitted out the Pocket PC Bluetooth serial port
'when green ButtonI is pressed.  If ULflag = 0 then
'the lower case ASCII character i will be transmitted.
'If ULflag = 1 then the upper case character I will be
'transmitted.  In either case, upper or lower, the status
'label at the top of the Form will be updated showing
'the ASCII character that has been transmitted.


Sub ButtonI_Click
If ULflag=0 Then
   serial.Output ("i")
   label1.Text = strlabeltemp & "i"
End If
If ULflag=1 Then
   serial.Output ("I")
   label1.Text = strlabeltemp & "I"
End If
End Sub


'This subroutine handles the transmission of ASCII
'characters: J or j when green ButtonJ is pressed
'on the software applications main Form.
'The ULflag determines which ASCII character is
'transmitted out the Pocket PC Bluetooth serial port
'when green ButtonJ is pressed.  If ULflag = 0 then
'the lower case ASCII character j will be transmitted.
'If ULflag = 1 then the upper case character J will be
'transmitted.  In either case, upper or lower, the status
'label at the top of the Form will be updated showing
'the ASCII character that has been transmitted.


Sub ButtonJ_Click
If ULflag=0 Then
   serial.Output ("j")
   label1.Text = strlabeltemp & "j"
End If
If ULflag=1 Then
   serial.Output ("J")
   label1.Text = strlabeltemp & "J"
End If
End Sub


'This subroutine handles the transmission of ASCII
'characters: K or k when green ButtonK is pressed
'on the software applications main Form.
'The ULflag determines which ASCII character is
'transmitted out the Pocket PC Bluetooth serial port
'when green ButtonK is pressed.  If ULflag = 0 then
'the lower case ASCII character k will be transmitted.
'If ULflag = 1 then the upper case character K will be
'transmitted.  In either case, upper or lower, the status
'label at the top of the Form will be updated showing
'the ASCII character that has been transmitted.


Sub ButtonK_Click
If ULflag=0 Then
   serial.Output ("k")
   label1.Text = strlabeltemp & "k"
End If
If ULflag=1 Then
   serial.Output ("K")
   label1.Text = strlabeltemp & "K"
End If
End Sub


'This subroutine handles the transmission of ASCII
'characters: L or l when green ButtonL is pressed
'on the software applications main Form.
'The ULflag determines which ASCII character is
'transmitted out the Pocket PC Bluetooth serial port
'when green ButtonL is pressed.  If ULflag = 0 then
'the lower case ASCII character l will be transmitted.
'If ULflag = 1 then the upper case character L will be
'transmitted.  In either case, upper or lower, the status
'label at the top of the Form will be updated showing
'the ASCII character that has been transmitted.


Sub ButtonL_Click
If ULflag=0 Then
   serial.Output ("l")
   label1.Text = strlabeltemp & "l"
End If
If ULflag=1 Then
   serial.Output ("L")
   label1.Text = strlabeltemp & "L"
End If
End Sub


'This subroutine handles the transmission of ASCII
'characters: M or m when green ButtonM is pressed
'on the software applications main Form.
'The ULflag determines which ASCII character is
'transmitted out the Pocket PC Bluetooth serial port
'when green ButtonM is pressed.  If ULflag = 0 then
'the lower case ASCII character m will be transmitted.
'If ULflag = 1 then the upper case character M will be
'transmitted.  In either case, upper or lower, the status
'label at the top of the Form will be updated showing
'the ASCII character that has been transmitted.


Sub ButtonM_Click
If ULflag=0 Then
   serial.Output ("m")
   label1.Text = strlabeltemp & "m"
End If
If ULflag=1 Then
   serial.Output ("M")
   label1.Text = strlabeltemp & "M"
End If
End Sub


'This subroutine handles the transmission of ASCII
'characters: N or n when green ButtonN is pressed
'on the software applications main Form.
'The ULflag determines which ASCII character is
'transmitted out the Pocket PC Bluetooth serial port
'when green ButtonN is pressed.  If ULflag = 0 then
'the lower case ASCII character n will be transmitted.
'If ULflag = 1 then the upper case character N will be
'transmitted.  In either case, upper or lower, the status
'label at the top of the Form will be updated showing
'the ASCII character that has been transmitted.


Sub ButtonN_Click
If ULflag=0 Then
   serial.Output ("n")
   label1.Text = strlabeltemp & "n"
End If
If ULflag=1 Then
   serial.Output ("N")
   label1.Text = strlabeltemp & "N"
End If
End Sub


'This subroutine handles the transmission of ASCII
'characters: O or o when green ButtonO is pressed
'on the software applications main Form.
'The ULflag determines which ASCII character is
'transmitted out the Pocket PC Bluetooth serial port
'when green ButtonO is pressed.  If ULflag = 0 then
'the lower case ASCII character o will be transmitted.
'If ULflag = 1 then the upper case character O will be
'transmitted.  In either case, upper or lower, the status
'label at the top of the Form will be updated showing
'the ASCII character that has been transmitted.


Sub ButtonO_Click
If ULflag=0 Then
   serial.Output ("o")
   label1.Text = strlabeltemp & "o"
End If
If ULflag=1 Then
   serial.Output ("O")
   label1.Text = strlabeltemp & "O"
End If
End Sub


'This subroutine handles the transmission of ASCII
'characters: P or p when green ButtonP is pressed
'on the software applications main Form.
'The ULflag determines which ASCII character is
'transmitted out the Pocket PC Bluetooth serial port
'when green ButtonP is pressed.  If ULflag = 0 then
'the lower case ASCII character p will be transmitted.
'If ULflag = 1 then the upper case character P will be
'transmitted.  In either case, upper or lower, the status
'label at the top of the Form will be updated showing
'the ASCII character that has been transmitted.


Sub ButtonP_Click
If ULflag=0 Then
   serial.Output ("p")
   label1.Text = strlabeltemp & "p"
End If
If ULflag=1 Then
   serial.Output ("P")
   label1.Text = strlabeltemp & "P"
End If
End Sub


'This subroutine handles the transmission of ASCII
'characters: Q or q when green ButtonQ is pressed
'on the software applications main Form.
'The ULflag determines which ASCII character is
'transmitted out the Pocket PC Bluetooth serial port
'when green ButtonQ is pressed.  If ULflag = 0 then
'the lower case ASCII character q will be transmitted.
'If ULflag = 1 then the upper case character Q will be
'transmitted.  In either case, upper or lower, the status
'label at the top of the Form will be updated showing
'the ASCII character that has been transmitted.


Sub ButtonQ_Click
If ULflag=0 Then
   serial.Output ("q")
   label1.Text = strlabeltemp & "q"
End If
If ULflag=1 Then
   serial.Output ("Q")
   label1.Text = strlabeltemp & "Q"
End If
End Sub


'This subroutine handles the transmission of ASCII
'characters: R or r when green ButtonR is pressed
'on the software applications main Form.
'The ULflag determines which ASCII character is
'transmitted out the Pocket PC Bluetooth serial port
'when green ButtonR is pressed.  If ULflag = 0 then
'the lower case ASCII character r will be transmitted.
'If ULflag = 1 then the upper case character R will be
'transmitted.  In either case, upper or lower, the status
'label at the top of the Form will be updated showing
'the ASCII character that has been transmitted.


Sub ButtonR_Click
 If ULflag=0 Then
   serial.Output ("r")
   label1.Text = strlabeltemp & "r"
End If
If ULflag=1 Then
   serial.Output ("R")
   label1.Text = strlabeltemp & "R"
End If
End Sub


'This subroutine handles the transmission of ASCII
'characters: S or s when green ButtonS is pressed
'on the software applications main Form.
'The ULflag determines which ASCII character is
'transmitted out the Pocket PC Bluetooth serial port
'when green ButtonS is pressed.  If ULflag = 0 then
'the lower case ASCII character s will be transmitted.
'If ULflag = 1 then the upper case character S will be
'transmitted.  In either case, upper or lower, the status
'label at the top of the Form will be updated showing
'the ASCII character that has been transmitted.


Sub ButtonS_Click
If ULflag=0 Then
   serial.Output ("s")
   label1.Text = strlabeltemp & "s"
End If
If ULflag=1 Then
   serial.Output ("S")
   label1.Text = strlabeltemp & "S"
End If
End Sub


'This subroutine handles the transmission of ASCII
'characters: T or t when green ButtonT is pressed
'on the software applications main Form.
'The ULflag determines which ASCII character is
'transmitted out the Pocket PC Bluetooth serial port
'when green ButtonT is pressed.  If ULflag = 0 then
'the lower case ASCII character t will be transmitted.
'If ULflag = 1 then the upper case character T will be
'transmitted.  In either case, upper or lower, the status
'label at the top of the Form will be updated showing
'the ASCII character that has been transmitted.


Sub ButtonT_Click
If ULflag=0 Then
   serial.Output ("t")
   label1.Text = strlabeltemp & "t"
End If
If ULflag=1 Then
   serial.Output ("T")
   label1.Text = strlabeltemp & "T"
End If
End Sub


'This subroutine handles the transmission of ASCII
'characters: U or u when green ButtonU is pressed
'on the software applications main Form.
'The ULflag determines which ASCII character is
'transmitted out the Pocket PC Bluetooth serial port
'when green ButtonU is pressed.  If ULflag = 0 then
'the lower case ASCII character u will be transmitted.
'If ULflag = 1 then the upper case character U will be
'transmitted.  In either case, upper or lower, the status
'label at the top of the Form will be updated showing
'the ASCII character that has been transmitted.


Sub ButtonU_Click
If ULflag=0 Then
   serial.Output ("u")
   label1.Text = strlabeltemp & "u"
End If
If ULflag=1 Then
   serial.Output ("U")
   label1.Text = strlabeltemp & "U"
End If
End Sub


'This subroutine handles the transmission of ASCII
'characters: V or v when green ButtonV is pressed
'on the software applications main Form.
'The ULflag determines which ASCII character is
'transmitted out the Pocket PC Bluetooth serial port
'when green ButtonV is pressed.  If ULflag = 0 then
'the lower case ASCII character v will be transmitted.
'If ULflag = 1 then the upper case character V will be
'transmitted.  In either case, upper or lower, the status
'label at the top of the Form will be updated showing
'the ASCII character that has been transmitted.


Sub ButtonV_Click
If ULflag=0 Then
   serial.Output ("v")
   label1.Text = strlabeltemp & "v"
End If
If ULflag=1 Then
   serial.Output ("V")
   label1.Text = strlabeltemp & "V"
End If
End Sub


'This subroutine handles the transmission of ASCII
'characters: W or w when green ButtonW is pressed
'on the software applications main Form.
'The ULflag determines which ASCII character is
'transmitted out the Pocket PC Bluetooth serial port
'when green ButtonW is pressed.  If ULflag = 0 then
'the lower case ASCII character w will be transmitted.
'If ULflag = 1 then the upper case character W will be
'transmitted.  In either case, upper or lower, the status
'label at the top of the Form will be updated showing
'the ASCII character that has been transmitted.


Sub ButtonW_Click
If ULflag=0 Then
   serial.Output ("w")
   label1.Text = strlabeltemp & "w"
End If
If ULflag=1 Then
   serial.Output ("W")
   label1.Text = strlabeltemp & "W"
End If
End Sub


'This subroutine handles the transmission of ASCII
'characters: X or x when green ButtonX is pressed
'on the software applications main Form.
'The ULflag determines which ASCII character is
'transmitted out the Pocket PC Bluetooth serial port
'when green ButtonX is pressed.  If ULflag = 0 then
'the lower case ASCII character x will be transmitted.
'If ULflag = 1 then the upper case character X will be
'transmitted.  In either case, upper or lower, the status
'label at the top of the Form will be updated showing
'the ASCII character that has been transmitted.


Sub ButtonX_Click
If ULflag=0 Then
   serial.Output ("x")
   label1.Text = strlabeltemp & "x"
End If
If ULflag=1 Then
   serial.Output ("X")
   label1.Text = strlabeltemp & "X"
End If
End Sub


'This subroutine handles the transmission of ASCII
'characters: Y or y when green ButtonY is pressed
'on the software applications main Form.
'The ULflag determines which ASCII character is
'transmitted out the Pocket PC Bluetooth serial port
'when green ButtonY is pressed.  If ULflag = 0 then
'the lower case ASCII character y will be transmitted.
'If ULflag = 1 then the upper case character Y will be
'transmitted.  In either case, upper or lower, the status
'label at the top of the Form will be updated showing
'the ASCII character that has been transmitted.


Sub ButtonY_Click
If ULflag=0 Then
   serial.Output ("y")
   label1.Text = strlabeltemp & "y"
End If
If ULflag=1 Then
   serial.Output ("Y")
   label1.Text = strlabeltemp & "Y"
End If
End Sub


'This subroutine handles the transmission of ASCII
'characters: Z or z when green ButtonZ is pressed
'on the software applications main Form.
'The ULflag determines which ASCII character is
'transmitted out the Pocket PC Bluetooth serial port
'when green ButtonZ is pressed.  If ULflag = 0 then
'the lower case ASCII character z will be transmitted.
'If ULflag = 1 then the upper case character Z will be
'transmitted.  In either case, upper or lower, the status
'label at the top of the Form will be updated showing
'the ASCII character that has been transmitted.


Sub ButtonZ_Click
If ULflag=0 Then
   serial.Output ("z")
   label1.Text = strlabeltemp & "z"
End If
If ULflag=1 Then
   serial.Output ("Z")
   label1.Text = strlabeltemp & "Z"
End If
End Sub


'This subroutine handles the transmission of ASCII
'character: 0 when yellow Button0 is pressed
'on the software applications main Form.


Sub Button0_Click
  serial.Output ("0")
  label1.Text = strlabeltemp & "0"
End Sub


'This subroutine handles the transmission of ASCII
'character: 1 when yellow Button1 is pressed
'on the software applications main Form.


Sub Button1_Click
  serial.Output ("1")
  label1.Text = strlabeltemp & "1"
End Sub


'This subroutine handles the transmission of ASCII
'character: 2 when yellow Button2 is pressed
'on the software applications main Form.


Sub Button2_Click
  serial.Output ("2")
  label1.Text = strlabeltemp & "2"
End Sub


'This subroutine handles the transmission of ASCII
'character: 3 when yellow Button3 is pressed
'on the software applications main Form.


Sub Button3_Click
  serial.Output ("3")
  label1.Text = strlabeltemp & "3"
End Sub


'This subroutine handles the transmission of ASCII
'character: 4 when yellow Button4 is pressed
'on the software applications main Form.


Sub Button4_Click
  serial.Output ("4")
  label1.Text = strlabeltemp & "4"
End Sub


'This subroutine handles the transmission of ASCII
'character: 5 when yellow Button5 is pressed
'on the software applications main Form.


Sub Button5_Click
  serial.Output ("5")
  label1.Text = strlabeltemp & "5"
End Sub


'This subroutine handles the transmission of ASCII
'character: 6 when yellow Button6 is pressed
'on the software applications main Form.


Sub Button6_Click
  serial.Output ("6")
  label1.Text = strlabeltemp & "6"
End Sub


'This subroutine handles the transmission of ASCII
'character: 7 when yellow Button7 is pressed
'on the software applications main Form.


Sub Button7_Click
  serial.Output ("7")
  label1.Text = strlabeltemp & "7"
End Sub


'This subroutine handles the transmission of ASCII
'character: 8 when yellow Button8 is pressed
'on the software applications main Form.


Sub Button8_Click
  serial.Output ("8")
  label1.Text = strlabeltemp & "8"
End Sub


'This subroutine handles the transmission of ASCII
'character: 9 when yellow Button9 is pressed
'on the software applications main Form.


Sub Button9_Click
  serial.Output ("9")
  label1.Text = strlabeltemp & "9"
End Sub


'This subroutine handles changing the text on the
'green alphabetic character buttons a thru z when
'the red UPPER button is pressed on the main Form.
'The ULflag is set equal to 1 to indicate upper case
'characters.  The text on each of the green alphabetic
'character buttons a thru z is changed to upper case
'letters A thru Z.


Sub UPPER_Click
    ULflag=1
    buttonA.Text="A"
    buttonB.Text="B"
    buttonC.Text="C"
    buttonD.Text="D"
    buttonE.Text="E"
    buttonF.Text="F"
    buttonG.Text="G"
    buttonH.Text="H"
    buttonI.Text="I"
    buttonJ.Text="J"
    buttonK.Text="K"
    buttonL.Text="L"
    buttonM.Text="M"
    buttonN.Text="N"
    buttonO.Text="O"
    buttonP.Text="P"
    buttonQ.Text="Q"
    buttonR.Text="R"
    buttonS.Text="S"
    buttonT.Text="T"
    buttonU.Text="U"
    buttonV.Text="V"
    buttonW.Text="W"
    buttonX.Text="X"
    buttonY.Text="Y"
    buttonZ.Text="Z"
End Sub


'This subroutine handles changing the text on the
'green alphabetic character buttons A thru Z when
'the red LOWER button is pressed on the main Form.
'The ULflag is set equal to 0 to indicate lower case
'characters.  The text on each of the green alphabetic
'character buttons A thru Z is changed to lower case
'letters a thru z.


Sub LOWER_Click
    ULflag=0
    buttonA.Text="a"
    buttonB.Text="b"
    buttonC.Text="c"
    buttonD.Text="d"
    buttonE.Text="e"
    buttonF.Text="f"
    buttonG.Text="g"
    buttonH.Text="h"
    buttonI.Text="i"
    buttonJ.Text="j"
    buttonK.Text="k"
    buttonL.Text="l"
    buttonM.Text="m"
    buttonN.Text="n"
    buttonO.Text="o"
    buttonP.Text="p"
    buttonQ.Text="q"
    buttonR.Text="r"
    buttonS.Text="s"
    buttonT.Text="t"
    buttonU.Text="u"
    buttonV.Text="v"
    buttonW.Text="w"
    buttonX.Text="x"
    buttonY.Text="y"
    buttonZ.Text="z"
End Sub


'This subroutine clears the Transmit TextBox window
'when the CLEARTX button is pressed on the main Form.
'The status label at the top of the main Form is also
'updated.


Sub CLEARTX_Click
    textbox1.Text=""
    label1.Text = strlabeltemp
End Sub


'This subroutine clears the Receive TextBox window
'when the CLEARRX button is pressed on the main Form.
'The status label at the top of the main Form is also
'updated.


Sub CLEARRX_Click
    textbox2.Text=""
    label1.Text = strlabeltemp
End Sub


'This subroutine will Transmit the ASCII characters
'that it finds in the Transmit TextBox window out
'the wireless Bluetooth serial port.  The ASCII
'characters are entered into the Transmit TextBox
'window using the Soft Input Panel Keyboard.


Sub SENDTX_Click
    serial.Output (textbox1.Text)
End Sub


'This subroutine handles the transmission of ASCII
'character: ! when blue SpButton1 is pressed
'on the software applications main Form.


Sub SpButton1_Click
    serial.Output ("!")
    label1.Text = strlabeltemp & "!"
End Sub


'This subroutine handles the transmission of ASCII
'character: @ when blue SpButton2 is pressed
'on the software applications main Form.


Sub SpButton2_Click
    serial.Output ("@")
    label1.Text = strlabeltemp & "@"
End Sub


'This subroutine handles the transmission of ASCII
'character: # when blue SpButton3 is pressed
'on the software applications main Form.


Sub SpButton3_Click
    serial.Output ("#")
    label1.Text = strlabeltemp & "#"
End Sub


'This subroutine handles the transmission of ASCII
'character: $ when blue SpButton4 is pressed
'on the software applications main Form.


Sub SpButton4_Click
    serial.Output ("$")
    label1.Text = strlabeltemp & "$"
End Sub


'This subroutine handles the transmission of ASCII
'character: % when blue SpButton5 is pressed
'on the software applications main Form.


Sub SpButton5_Click
    serial.Output ("%")
    label1.Text = strlabeltemp & "%"
End Sub


'This subroutine handles the transmission of ASCII
'character: ^ when blue SpButton6 is pressed
'on the software applications main Form.


Sub SpButton6_Click
    serial.Output ("^")
    label1.Text = strlabeltemp & "^"
End Sub


'This subroutine handles the transmission of ASCII
'character: = when blue SpButton7 is pressed
'on the software applications main Form.


Sub SpButton7_Click
    serial.Output ("=")
    label1.Text = strlabeltemp & "="
End Sub


'This subroutine handles the transmission of ASCII
'character: * when blue SpButton8 is pressed
'on the software applications main Form.


Sub SpButton8_Click
    serial.Output ("*")
    label1.Text = strlabeltemp & "*"
End Sub


'This subroutine handles the transmission of ASCII
'character: ( when blue SpButton9 is pressed
'on the software applications main Form.


Sub SpButton9_Click
    serial.Output ("(")
    label1.Text = strlabeltemp & "("
End Sub


'This subroutine handles the transmission of ASCII
'character: ) when blue SpButton10 is pressed
'on the software applications main Form.


Sub SpButton10_Click
    serial.Output (")")
    label1.Text = strlabeltemp & ")"
End Sub


'This subroutine handles the transmission of ASCII
'character: \ when blue SpButton11 is pressed
'on the software applications main Form.


Sub SpButton11_Click
    serial.Output ("\")
    label1.Text = strlabeltemp & "\"
End Sub


'This subroutine handles the transmission of ASCII
'character: / when blue SpButton12 is pressed
'on the software applications main Form.


Sub SpButton12_Click
    serial.Output ("/")
    label1.Text = strlabeltemp & "/"
End Sub


'This subroutine handles the transmission of ASCII
'character: ; when blue SpButton13 is pressed
'on the software applications main Form.


Sub SpButton13_Click
    serial.Output (";")
    label1.Text = strlabeltemp & ";"
End Sub


'This subroutine handles the transmission of ASCII
'character: - when blue SpButton14 is pressed
'on the software applications main Form.


Sub SpButton14_Click
    serial.Output ("-")
    label1.Text = strlabeltemp & "-"
End Sub


'This subroutine handles the transmission of ASCII
'character: | when blue SpButton15 is pressed
'on the software applications main Form.


Sub SpButton15_Click
    serial.Output ("|")
    label1.Text = strlabeltemp & "|"
End Sub


'This subroutine handles the transmission of ASCII
'character: , when blue SpButton16 is pressed
'on the software applications main Form.


Sub SpButton16_Click
    serial.Output (",")
    label1.Text = strlabeltemp & ","
End Sub


'This subroutine handles the transmission of ASCII
'character: < when blue SpButton17 is pressed
'on the software applications main Form.


Sub SpButton17_Click
    serial.Output ("<")
    label1.Text = strlabeltemp & "<"
End Sub


'This subroutine handles the transmission of ASCII
'character: > when blue SpButton18 is pressed
'on the software applications main Form.


Sub SpButton18_Click
    serial.Output (">")
    label1.Text = strlabeltemp & ">"
End Sub


'This subroutine handles the transmission of ASCII
'character: ? when blue SpButton19 is pressed
'on the software applications main Form.


Sub SpButton19_Click
    serial.Output ("?")
    label1.Text = strlabeltemp & "?"
End Sub


'This subroutine handles the transmission of ASCII
'character: ~ when blue SpButton20 is pressed
'on the software applications main Form.


Sub SpButton20_Click
    serial.Output ("~")
    label1.Text = strlabeltemp & "~"
End Sub


'This subroutine handles the transmission of ASCII
'character: { when blue SpButton21 is pressed
'on the software applications main Form.


Sub SpButton21_Click
    serial.Output ("{")
    label1.Text = strlabeltemp & "{"
End Sub


'This subroutine handles the transmission of ASCII
'character: } when blue SpButton22 is pressed
'on the software applications main Form.


Sub SpButton22_Click
    serial.Output ("}")
    label1.Text = strlabeltemp & "}"
End Sub


'This subroutine handles the transmission of ASCII
'character: [ when blue SpButton23 is pressed
'on the software applications main Form.


Sub SpButton23_Click
    serial.Output ("[")
    label1.Text = strlabeltemp & "["
End Sub


'This subroutine handles the transmission of ASCII
'character: ] when blue SpButton24 is pressed
'on the software applications main Form.


Sub SpButton24_Click
    serial.Output ("]")
    label1.Text = strlabeltemp & "]"
End Sub
This version has the Range Test feature
added along with Loop-Back control of
the BlueSmiRF Bluetooth module.