Check my VB code for showing the value send by PICmicroC

Status
Not open for further replies.

Cleong

Member level 2
Joined
Feb 17, 2006
Messages
53
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,789
i wan to know that the code i write right or not??
i wan to show the value send by PICmicroC (in ASCII code )
from pic output is A'A' to A'P'

////
Option Explicit

'declare variables
Dim n As Integer
Dim port As Integer

Private Sub clear_Click()
End

End Sub

Private Sub Form_Load()
MSComm1.Settings = "9600,N,8,1"
MSComm1.Handshaking = comNone
MSComm1.RThreshold = 1
MSComm1.SThreshold = 0
MSComm1.CommPort = 1
MSComm1.PortOpen = True
MSComm1.InputMode = MSCommLib.InputModeConstants.comInputModeText
'Don't mess with byte arrays, only works with simple data (characters A-Z and numbers)
MSComm1.InputLen = 0
'Read the entire waiting data when com.Input is used
MSComm1.NullDiscard = False
'Don't discard nulls, 0x00 is a useful byte

End Sub

Private Sub Timer1_Timer()
lbldate.Caption = Format(Now, "dd / mm / yyyy")
lbltime.Caption = Format(Now, "hh:mm:ss AM/PM")
End Sub

Private Sub Timer7_Timer()
lblinput.Caption = Inp(port)

If lblinput.Caption = 41 Then
lblSig.Caption = "Temperaure = 23'C"

End If

If lblinput.Caption = 42 Then
lblSig.Caption = "Temperaure = 24'C"

End If

If lblinput.Caption = &H43 Then
lblSig.Caption = "Temperaure = 25'C"

End If

If lblinput.Caption = &H44 Then
lblSig.Caption = "Temperaure = 26'C"

End If

If lblinput.Caption = &H45 Then
lblSig.Caption = "Temperaure = 27'C"

End If

If lblinput.Caption = &H46 Then
lblSig.Caption = "Temperaure = 28'C"

End If

If lblinput.Caption = &H47 Then
lblSig.Caption = "Temperaure = 29'C"

End If

If lblinput.Caption = &H48 Then
lblSig.Caption = "Temperaure = 30'C"

End If

If lblinput.Caption = &H49 Then
lblSig.Caption = "Temperaure = 31'C"

End If

If lblinput.Caption = &H4A Then
lblSig.Caption = "Temperaure = 32'C"

End If

If lblinput.Caption = &H4B Then
lblSig.Caption = "Temperaure = 33'C"

End If

If lblinput.Caption = &H4C Then
lblSig.Caption = "Temperaure = 34'C"

End If

If lblinput.Caption = &H4D Then
lblSig.Caption = "Temperaure = 35'C"

End If

If lblinput.Caption = &H4E Then
lblSig.Caption = "Temperaure = 36'C"

End If

If lblinput.Caption = &H4F Then
lblSig.Caption = "Temperaure = 37'C"

End If

If lblinput.Caption = &H50 Then
lblSig.Caption = "???"

End If
End Sub
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…