Hi!
I am trying to send a temperature (LM335) from the arduino to my visual basic 6.0 program and sofar i get the correct temp inside the "serial monitor" but when i try to receive it in VB6 all i get is a large number.
ex
Serial monitor 24.11
VB6 11870
here´s the vb program
Private Sub Form_Load()
' Fire Rx Event Every Two Bytes
MSComm1.RThreshold = 2
' When Inputting Data, Input 2 Bytes at a time
MSComm1.InputLen = 2
' 2400 Baud, No Parity, 8 Data Bits, 1 Stop Bit
MSComm1.Settings = "9600,N,8,1"
' Make sure DTR line is low to prevent Stamp reset
MSComm1.DTREnable = False
' Open COM3
MSComm1.CommPort = 3
MSComm1.PortOpen = True
End Sub
Private Sub MSComm1_OnComm()
Dim sData As String
Dim lHighByte As Long
Dim lLowByte As Long
Dim lByte As Long
' If Rx Event then get data and process
If MSComm1.CommEvent = comEvReceive Then
sData = MSComm1.Input ' Get data
lHighByte = Asc(Mid$(sData, 1, 1)) ' get 1st byte
lLowByte = Asc(Mid$(sData, 2, 1)) ' Get 2nd byte
lByte = JoinHighLow(lHighByte, lLowByte)
Label2.Caption = CStr(lByte)
DrawScale lByte
End If
End Sub
what do i do wrong?
i want to get 24 in the vb6 instead
robban