|
-
Dec 15th, 2005, 10:40 PM
#1
Thread Starter
New Member
visual basic and pic
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
-
Dec 16th, 2005, 10:52 AM
#2
Re: visual basic and pic
Hi seamann, welcome to VBForums! 
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
-
Dec 16th, 2005, 04:39 PM
#3
Thread Starter
New Member
Re: visual basic and pic
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 :
VB Code:
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 [vbcode][/vbcode] tags for clarity - Hack
Last edited by Hack; Dec 18th, 2005 at 06:37 AM.
-
Dec 19th, 2005, 04:17 AM
#4
Re: visual basic and pic
MSComm1.Output=Chr(48)
or
MSComm1.Output="0"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|