Results 1 to 4 of 4

Thread: visual basic and pic

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2005
    Posts
    2

    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

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    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

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 2005
    Posts
    2

    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:
    1. Option Explicit
    2.  
    3. Private Sub cboBaud_Click()
    4.  
    5. On Error GoTo BaudErr
    6.  
    7. If MSComm1.PortOpen Then
    8.   MSComm1.PortOpen = False
    9. End If
    10. MSComm1.Settings = cboBaud.Text & ",n,8,1"
    11. MSComm1.PortOpen = True
    12.  
    13. BaudErr:
    14.  
    15. If Err <> 0 Then
    16.   MsgBox Error$(Err)
    17. End If
    18.  
    19. 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.

  4. #4
    Fanatic Member namrekka's Avatar
    Join Date
    Feb 2005
    Location
    Netherlands
    Posts
    639

    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
  •  



Click Here to Expand Forum to Full Width