PDA

Click to See Complete Forum and Search --> : visual basic and pic


seamann
Dec 15th, 2005, 09:40 PM
HI ALL,

Can anybody tell me how can I send ascii code from the visual basic to the pic microcontroller, by using rs232 and max232 from com1, for example I want to send ‘0’ to the pic which d’48’ how can I do that ?

i'm trying to create command button and config as '0' and when i'm clicking to this button it's sending d'48' to the pic. (not specific '0' keyboard key)
so can anybody provide me with program can do that,

thanks

si_the_geek
Dec 16th, 2005, 09:52 AM
Hi seamann, welcome to VBForums! :wave:

There has been a few discussions about this recently, here is what looks like the best of them:
http://www.vbforums.com/showthread.php?t=239343

seamann
Dec 16th, 2005, 03:39 PM
hello to you all,

first thanks alot for the reply,

let have example to understand that better , to create command button in the visual basic and lets say if i press this button it's gonna send the character '0' which is d'48'(ACSII CODE) to the pic first i've to configure the MScomm

i did that so far :Option Explicit

Private Sub cboBaud_Click()

On Error GoTo BaudErr

If MSComm1.PortOpen Then
MSComm1.PortOpen = False
End If
MSComm1.Settings = cboBaud.Text & ",n,8,1"
MSComm1.PortOpen = True

BaudErr:

If Err <> 0 Then
MsgBox Error$(Err)
End If

End Sub

so now, the problem how i'm going to send the d'48' to the pic,

thanks






Added tags for clarity - Hack

namrekka
Dec 19th, 2005, 03:17 AM
MSComm1.Output=Chr(48)

or

MSComm1.Output="0"