Bluetooth PDA to BLUESMIRF Communication.
This example will show you how to use a POCKET PC with built-in bluetooth
hardware to send serial data to a BLUESMIRF bluetooth module. The BLUESMIRF
will send the received serial data to a host CPU. The host CPU will pass the received
data to an external CPU when it is requested to do so.
The PDA used in this example is an HP IPAQ H2210 Pocket PC.
The host CPU used in this example is an ATHENA microcontroller.
The external CPU used in this example is a Personal Computer running Windows XP.
The application software for the Pocket PC was written in the BASIC programming
language using the Basic4ppc compiler for the POCKET PC.
The microcontroller code for the ATHENA was written in BASIC using the Kronos
Robotics Athena Editor software Version 2.0.9 which runs on Windows XP.
This example will show you how to establish a bluetooth connection between the
POCKET PC and the BLUESMIRF bluetooth module. The application software
will open a Serial COM Port and send serial data using the PDA's built-in bluetooth
hardware to the external BLUESMIRF bluetooth module.
Lets get Started !















The BLUESMIRF module is shipped with factory default configuration settings. In this
example we want to use these factory default settings straight out of the box and not have to
change any of them to use the BLUESMIRF module.
One of the factory default settings is "Long Response" mode. When the BLUESMIRF
performs a specific task it will send a response ( which is a string of characters ) out its TX pin
to the host CPU to let it know what has happened. In this example, we have to deal with the
following actions:
COM
Port Open
COM Port Closed
When the POCKET PC PDA application software Opens a COM Port the BLUESMIRF
module will send a string of characters to the host CPU.
When the POCKET PC PDA application software Closes a COM Port the BLUESMIRF
module will send a string of characters to the host CPU.
The BLUESMIRF module that I have sends the following strings to the host CPU:
COM Port Open: ( The BLUESMIRF module will send the string )
CONNECT,00043E431B14
COM Port Closed: ( The BLUESMIRF module will send the string )
DISCONNECT
The diagram below shows the steps needed to send serial data from the POCKET PC
PDA to the BLUESMIRF Module to the External CPU.

The following program statement in the ATHENA microcontroller code will read every byte of data
that is sent to the ATHENA by the BLUESMIRF module.
loop1: serin loop1,0,a
When the Serial COM Port is Opened or Closed the above line of ATHENA program code will read in
each byte that is recieved from the BLUESMIRF module and store the received bytes, one right after the
other, in the variable "a". Each byte in the string will be read and stored in the variable "a", the ATHENA
will read in the entire string that is sent to it by the BLUESMIRF module. The bytes in the string will be
ignored since the ATHENA will not process or store any of the bytes. By using a Flag variable and 2 special
characters, we can control when we want the ATHENA to actually look at and process the bytes that it
receives from the BLUESMIRF module.

ATHENA Microcontroller Program Code.
'A sample program written for the ATHENA microcontroller
'which will recieve serial data sent from the POCKET PC
'to the BLUESMIRF module across the Bluetooth wireless
'link. After the BLUESMIRF module has received the serial
'data it will be sent to the ATHENA microcontroller. The
'ATHENA will send the serial data it receives to the
'ATHENA DEBUG TERMINAL software running on the PC.
'The KRONOS ROBOTICS ATHENA EDITOR Version 2.0.9 was
'used to Write the program code, Test, Debug and Program
'the compiled code into the ATHENA microcontroller.
'Dimension the variables used by the program.
dim a,s2cpu
'Initialize the Send to Cpu Flag equal to Zero.
'When this Flag = 0 No data will be passed to the
'external CPU. When this Flag = 1 data will be
'passed to the external CPU.
s2cpu=0
'Initialize Port Pin 0 as an Input. Serial data
'received by the BLUESMIRF module from the POCKET
'PC PDA across the Bluetooth connection will be
'received by the ATHENA microcontroller at its
'Port Pin 0. The TX line of the BLUESMIRF module
'is physically wired to Port Pin 0 of the ATHENA.
input 0
'Set the Baud rate on the ATHENA to 9600:N:8:1
setbaud SBAUD9600
'The following line of code will read the serial data
'being sent to Port Pin 0 of the ATHENA. If no data
'is currently being received at Port Pin 0 then program
'control will jump back to the label ( loop1 ). This
'program statement will continually jump back to label
'( loop1 ) until an 8-bit byte is received a Port Pin 0.
'When an 8-bit byte is received at Port Pin 0, the
'received character byte will be stored in the program
'variable ( a ) and program execution will fall through
'to the next line of program code.
loop1: serin loop1,0,a
'If the application running on the POCKET PC PDA sends
'the special character ( * ) then set the ( s2cpu ) flag = 1.
'This will tell the ATHENA to send the received 8-bit
'character byte to the external CPU. In this example
'the external CPU is a Personal Computer. Once the
'( s2cpu ) flag has been set equal to 1, then jump back
'to program label ( loop1 ) to receive the next byte.
if a=42 then
s2cpu=1
goto loop1
endif
'If the application running on the POCKET PC PDA sends
'the special character ( ^ ) then set the ( s2cpu ) flag = 0.
'This will tell the ATHENA not to send the received 8-bit
'character byte to the external CPU. In this example
'the external CPU is a Personal Computer. Once the
'( s2cpu ) flag has been set equal to 0, then jump back
'to program label ( loop1 ) to receive the next byte.
if a=94 then
s2cpu=0
goto loop1
endif
'If the (s2cpu) flag equals 1 then send the byte received
'to the external CPU. In this example the program statement
'( print a ) will send the received byte to the Personal
'Computer which will display the character in the ATHENA
'DEBUG TERMINAL. After sending the received byte to the
'Personal Computer, program control will jump back to
'program label ( loop1 ).
if s2cpu=1 then
print a
endif
goto loop1
Serial Ports, BASIC4PPC and the "SerialDevice.dll"
In order to write application programs that send & receive data
using Serial Ports you must include the "SerialDevice.dll"
in your project before compiling your code. The following steps
show you how to add the "SerialDevice.dll" to a project when using
the Basic4ppc Compiler for the Pocket PC.






The application program written for this example only uses four
program statements to send data using the Pocket PC serial port.
This program statement initializes the Serial Port:
serial.New2 (8,9600,"N",8,1)
The COM Port is set to 8.
The BAUD rate is set to 9600.
There is "No" Parity.
The number of bits is 8.
There is only 1 Stop bit.
This program statement Opens the COM Port.
serial.PortOpen=true
This program statement Closes the COM Port.
serial.PortOpen=false
This program statement sends data out the COM Port.
serial.Output ("A")
BASIC4PPC Application Program Code Listing.
The following program listing is the code for the Pocket PC application used in this example.
Sub Globals
x=0
portflag = 0
strlabel0="COM 8 > 9600,N,8,1"
strlabel1=" [CLOSED]"
strlabel2=" [ OPEN ]"
strlabel3=" TX= "
strlabeltemp=""
End Sub
Sub App_Start
Form1.show
label1.Text = strlabel0 & strlabel1 & strlabel3
strlabeltemp = strlabel0 & strlabel1 & strlabel3
serial.New2 (8,9600,"N",8,1)
End Sub
Sub Button1_Click
If portflag = 0 Then
serial.PortOpen=true
portflag = 1
label1.Text = strlabel0 & strlabel2 & strlabel3
strlabeltemp=label1.Text
For x=0 To 3000
Next
serial.Output ("*")
End If
End Sub
Sub Button2_Click
If portflag = 1 Then
serial.Output ("^")
For x=0 To 3000
Next
serial.PortOpen=false
portflag = 0
label1.Text = strlabel0 & strlabel1 & strlabel3
strlabeltemp=label1.Text
End If
End Sub
Sub Button3_Click
serial.Output ("A")
label1.Text = strlabeltemp & "A"
End Sub
Sub Button4_Click
serial.Output ("B")
label1.Text = strlabeltemp & "B"
End Sub
Sub Button5_Click
serial.Output ("C")
label1.Text = strlabeltemp & "C"
End Sub
Sub Button6_Click
serial.Output ("D")
label1.Text = strlabeltemp & "D"
End Sub
Sub Button7_Click
serial.Output ("E")
label1.Text = strlabeltemp & "E"
End Sub
Sub Button8_Click
serial.Output ("F")
label1.Text = strlabeltemp & "F"
End Sub
Sub Button9_Click
serial.Output ("G")
label1.Text = strlabeltemp & "G"
End Sub
Sub Button10_Click
serial.Output ("H")
label1.Text = strlabeltemp & "H"
End Sub
Sub Button11_Click
serial.Output ("I")
label1.Text = strlabeltemp & "I"
End Sub
Sub Button12_Click
serial.Output ("J")
label1.Text = strlabeltemp & "J"
End Sub
Sub Button13_Click
serial.Output ("K")
label1.Text = strlabeltemp & "K"
End Sub
Sub Button14_Click
serial.Output ("L")
label1.Text = strlabeltemp & "L"
End Sub
Sub Button15_Click
serial.Output ("M")
label1.Text = strlabeltemp & "M"
End Sub
Sub Button16_Click
serial.Output ("N")
label1.Text = strlabeltemp & "N"
End Sub
Sub Button17_Click
serial.Output ("O")
label1.Text = strlabeltemp & "O"
End Sub
Sub Button18_Click
serial.Output ("P")
label1.Text = strlabeltemp & "P"
End Sub
Sub Button19_Click
serial.Output ("Q")
label1.Text = strlabeltemp & "Q"
End Sub
Sub Button20_Click
serial.Output ("R")
label1.Text = strlabeltemp & "R"
End Sub
Sub Button21_Click
serial.Output ("S")
label1.Text = strlabeltemp & "S"
End Sub
Sub Button22_Click
serial.Output ("T")
label1.Text = strlabeltemp & "T"
End Sub
Sub Button23_Click
serial.Output ("U")
label1.Text = strlabeltemp & "U"
End Sub
Sub Button24_Click
serial.Output ("V")
label1.Text = strlabeltemp & "V"
End Sub
Sub Button25_Click
serial.Output ("W")
label1.Text = strlabeltemp & "W"
End Sub
Sub Button26_Click
serial.Output ("X")
label1.Text = strlabeltemp & "X"
End Sub
Sub Button27_Click
serial.Output ("Y")
label1.Text = strlabeltemp & "Y"
End Sub
Sub Button28_Click
serial.Output ("Z")
label1.Text = strlabeltemp & "Z"
End Sub
Sub Button29_Click
serial.Output ("0")
label1.Text = strlabeltemp & "0"
End Sub
Sub Button30_Click
serial.Output ("1")
label1.Text = strlabeltemp & "1"
End Sub
Sub Button31_Click
serial.Output ("2")
label1.Text = strlabeltemp & "2"
End Sub
Sub Button32_Click
serial.Output ("3")
label1.Text = strlabeltemp & "3"
End Sub
Sub Button33_Click
serial.Output ("4")
label1.Text = strlabeltemp & "4"
End Sub
Sub Button34_Click
serial.Output ("5")
label1.Text = strlabeltemp & "5"
End Sub
Sub Button35_Click
serial.Output ("6")
label1.Text = strlabeltemp & "6"
End Sub
Sub Button36_Click
serial.Output ("7")
label1.Text = strlabeltemp & "7"
End Sub
Sub Button37_Click
serial.Output ("8")
label1.Text = strlabeltemp & "8"
End Sub
Sub Button38_Click
serial.Output ("9")
label1.Text = strlabeltemp & "9"
End Sub
Sub Button39_Click
serial.Output ("a")
label1.Text = strlabeltemp & "a"
End Sub
Sub Button40_Click
serial.Output ("b")
label1.Text = strlabeltemp & "b"
End Sub
Sub Button41_Click
serial.Output ("c")
label1.Text = strlabeltemp & "c"
End Sub
Sub Button42_Click
serial.Output ("d")
label1.Text = strlabeltemp & "d"
End Sub
Sub Button43_Click
serial.Output ("e")
label1.Text = strlabeltemp & "e"
End Sub
Sub Button44_Click
serial.Output ("f")
label1.Text = strlabeltemp & "f"
End Sub
Sub Button45_Click
serial.Output ("g")
label1.Text = strlabeltemp & "g"
End Sub
Sub Button46_Click
serial.Output ("h")
label1.Text = strlabeltemp & "h"
End Sub
Sub Button47_Click
serial.Output ("i")
label1.Text = strlabeltemp & "i"
End Sub
Sub Button48_Click
serial.Output ("j")
label1.Text = strlabeltemp & "j"
End Sub
Sub Button49_Click
serial.Output ("k")
label1.Text = strlabeltemp & "k"
End Sub
Sub Button50_Click
serial.Output ("l")
label1.Text = strlabeltemp & "l"
End Sub
Sub Button51_Click
serial.Output ("m")
label1.Text = strlabeltemp & "m"
End Sub
Sub Button52_Click
serial.Output ("n")
label1.Text = strlabeltemp & "n"
End Sub
Sub Button53_Click
serial.Output ("o")
label1.Text = strlabeltemp & "o"
End Sub
Sub Button54_Click
serial.Output ("p")
label1.Text = strlabeltemp & "p"
End Sub
Sub Button55_Click
serial.Output ("q")
label1.Text = strlabeltemp & "q"
End Sub
Sub Button56_Click
serial.Output ("r")
label1.Text = strlabeltemp & "r"
End Sub
Sub Button57_Click
serial.Output ("s")
label1.Text = strlabeltemp & "s"
End Sub
Sub Button58_Click
serial.Output ("t")
label1.Text = strlabeltemp & "t"
End Sub
Sub Button59_Click
serial.Output ("u")
label1.Text = strlabeltemp & "u"
End Sub
Sub Button60_Click
serial.Output ("v")
label1.Text = strlabeltemp & "v"
End Sub
Sub Button61_Click
serial.Output ("w")
label1.Text = strlabeltemp & "w"
End Sub
Sub Button62_Click
serial.Output ("x")
label1.Text = strlabeltemp & "x"
End Sub
Sub Button63_Click
serial.Output ("y")
label1.Text = strlabeltemp & "y"
End Sub
Sub Button64_Click
serial.Output ("z")
label1.Text = strlabeltemp & "z"
End Sub
Sub Button65_Click
serial.Output ("#")
label1.Text = strlabeltemp & "#"
End Sub
Sub Button66_Click
serial.Output ("$")
label1.Text = strlabeltemp & "$"
End Sub
Sub Button67_Click
serial.Output ("%")
label1.Text = strlabeltemp & "%"
End Sub
Sub Button68_Click
serial.Output ("[")
label1.Text = strlabeltemp & "["
End Sub
Sub Button69_Click
serial.Output ("]")
label1.Text = strlabeltemp & "]"
End Sub
Sub Button70_Click
serial.Output ("@")
label1.Text = strlabeltemp & "@"
End Sub
Sub Button71_Click
serial.Output ("|")
label1.Text = strlabeltemp & "|"
End Sub
Sub Button72_Click
serial.Output ("<")
label1.Text = strlabeltemp & "<"
End Sub
Sub Button73_Click
serial.Output (">")
label1.Text = strlabeltemp & ">"
End Sub
Sub Button74_Click
serial.Output ("(")
label1.Text = strlabeltemp & "("
End Sub
Sub Button75_Click
serial.Output (")")
label1.Text = strlabeltemp & ")"
End Sub
Serial Transmit and Receive Example
This example shows how to write a simple application that will send and receive serial
data via a Bluetooth connection between a Pocket PC PDA and the BlueSMiRF Module.
To write a program that can send and receive serial data we need 4 program statements and 1 subroutine.
serial.New2 (8,9600,"N",8,1)
"This statement will Initialize the
Serial Com Port"
serial.PortOpen
= true (or) = false
"This statement will Open or Close the Serial Com Port"
serial.Output
("A")
"This
statement will send 1 character or a string of characters"
serial.EnableOnComm = true (or) = false "This statement will Enable or Disable Serial Com Port reception"
Sub serial_OnCom
"This subroutine is used to handle the Serial Data that is
received"
(... Put Program Statements here ...)
End Sub
To Initialize the Serial Com Port we need the following program statement:
serial.New2 (8,9600,"N",8,1)
To Open the Serial Com Port we need the following program statement:
serial.PortOpen=true
To Close the Serial Com Port we need the following program statement:
serial.PortOpen=false
To Send data out the Serial Com Port we need the following program statement:
serial.Output ("A")
To Enable the Receiving of Serial Data we need the following program statement:
serial.EnableOnComm=true
To Disable the Receiving of Serial Data we need the following Program statement:
serial.EnableOnComm=false
To handle the Serial Data once it has been Received we need the following Subroutine:
Sub serial_OnCom
(... Put Program Statements here ...)
End Sub
For this example, the BlueSMiRF Module will have its TX pin connected to its RX pin.
This will put the BlueSMiRF Module into a "loopback" mode where every byte that it
receives it will send back out via the wireless Bluetooth connection with the PDA. The
PDA will send bytes to the BlueSMiRF Module and the BlueSMiRF will send those bytes
right back to the PDA. The schematic of how the BlueSMiRF is connected is shown below:

Here is the application program running on the Pocket PC PDA.







Below is the program code listing for this example:
Sub Globals
x=0
ULfLAG=1
portflag = 0
strlabel0="COM 8: 9600,N,8,1"
strlabel1=" [OFF]"
strlabel2=" [ ON]"
strlabel3=" = "
strlabeltemp=""
End Sub
Sub App_Start
Form1.show
label1.Text = strlabel0 & strlabel1 & strlabel3
strlabeltemp = strlabel0 & strlabel1 & strlabel3
serial.New2 (8,9600,"N",8,1)
textbox1.FontSize=13
End Sub
Sub OpenPort_Click
If portflag = 0 Then
serial.PortOpen=true
portflag = 1
label1.Text = strlabel0 & strlabel2 & strlabel3
strlabeltemp=label1.Text
End If
serial.enableoncomm=true
End Sub
Sub ClosePort_Click
If portflag = 1 Then
TextBox1.Text=""
serial.enableoncomm=false
serial.PortOpen=false
portflag = 0
label1.Text = strlabel0 & strlabel1 & strlabel3
strlabeltemp=label1.Text
End If
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 serial_OnCom
TextBox1.Text=TextBox1.Text & serial.Inputstring
End Sub
Sub ClearWindow_Click
TextBox1.Text=""
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 Button31_Click
serial.Output ("0")
label1.Text = strlabeltemp & "0"
End Sub
Sub Button32_Click
serial.Output ("1")
label1.Text = strlabeltemp & "1"
End Sub
Sub Button33_Click
serial.Output ("2")
label1.Text = strlabeltemp & "2"
End Sub
Sub Button34_Click
serial.Output ("3")
label1.Text = strlabeltemp & "3"
End Sub
Sub Button35_Click
serial.Output ("4")
label1.Text = strlabeltemp & "4"
End Sub
Sub Button36_Click
serial.Output ("5")
label1.Text = strlabeltemp & "5"
End Sub
Sub Button37_Click
serial.Output ("6")
label1.Text = strlabeltemp & "6"
End Sub
Sub Button38_Click
serial.Output ("7")
label1.Text = strlabeltemp & "7"
End Sub
Sub Button39_Click
serial.Output ("8")
label1.Text = strlabeltemp & "8"
End Sub
Sub Button40_Click
serial.Output ("9")
label1.Text = strlabeltemp & "9"
End Sub
Sub Button51_Click
serial.Output ("$")
label1.Text = strlabeltemp & "$"
End Sub
Sub Button52_Click
serial.Output ("#")
label1.Text = strlabeltemp & "#"
End Sub
Sub Button53_Click
serial.Output ("%")
label1.Text = strlabeltemp & "%"
End Sub
Sub Button54_Click
serial.Output ("@")
label1.Text = strlabeltemp & "@"
End Sub
Sub Button55_Click
serial.Output ("!")
label1.Text = strlabeltemp & "!"
End Sub
Sub Button56_Click
serial.Output ("?")
label1.Text = strlabeltemp & "?"
End Sub
Sub ButtonLower_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 ButtonUpper_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