Sending Commands from Visual Basic about IR to Pic


Results 1 to 5 of 5

Threaded View

  1. #1
    tne_de's Avatar
    tne_de Guest

    Default Sending Commands from Visual Basic about IR to Pic

    Hello,
    i want to send commands about a Visual Basic (Express 2008) about IR to a pic.
    The IR Led is connected with my pc on COM 1.

    My VB Code Snippet:
    Code:
    [...]
    ' Connection to COM1
    With serialPort
        .PortName = cbbCOMPorts.Text 'COM1
        .BaudRate = 2400
        .Parity = IO.Ports.Parity.None
        .DataBits = 8
        .StopBits = IO.Ports.StopBits.One
    End With
    [...]
    serialPort.Write(txtDataToSend.Text) 'txtDataToSend = Input txt field

    My PBP Code for recipient
    Code:
    main:
    serin ir,0,["9999"],dat
        
        IF dat=1 THEN
        led2=turnoff
        led1=turnon
        ENDIF
       
        IF dat=5 THEN
        led1=turnoff
        led2=turnon
        ENDIF
    GOTO main
    My PBP Code for sender
    Code:
    main:
       SEROUT led5,12,["9999",1]
       PAUSE 100
       SEROUT led5,12,["9999",5]
       PAUSE 100
    GOTO main
    With this PBP Code it works regarding Pic to Pic communication.
    But if I send "99991" or "99995" by my Visual Basic programm it does not work.

    I read in the manual that the 12 in the SEROUT command send the data "open inverted" - what does it mean? How could I "open inverted" my command in Visual Basic (Express 2008)?

    Best regards

    EDIT: Additional Information I use a PIC 12F629
    Last edited by tne_de; - 1st April 2009 at 10:03. Reason: change options for Thread Subscription, add adiotional informations

Similar Threads

  1. Basic PIC circuit acting weird
    By FIONEX in forum General
    Replies: 3
    Last Post: - 9th October 2008, 01:04
  2. PIC BASIC Compiler for ARM machines?
    By stone20008 in forum General
    Replies: 2
    Last Post: - 22nd August 2008, 07:14
  3. pic to pic ir link versus wired link : help please anyone
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th May 2008, 21:01
  4. How to use 93C46 Type EEPROM using PIC Basic PRo
    By in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 1st April 2003, 04:07
  5. Help with MPASM and PIC Basic
    By johngb in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 21st February 2003, 13:07

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts