Problem in Serial Communication


Closed Thread
Results 1 to 3 of 3
  1. #1
    uuq1's Avatar
    uuq1 Guest

    Default Problem in Serial Communication

    I am getting the following error :
    expected ']'

    The source code is :
    '========================================
    Include "modedefs.bas"
    DEFINE OSC 20 '20MHz

    RecByte var byte

    Symbol PinIn = PortB.7

    Start:
    PAUSE 150
    TRISA=0 'PORTA PIN All outputs
    TRISB=%10000000 'PORTB ALL OUTPUTS
    PORTA=0 'CLEAR PORTA
    PORTB=0 'CLEAR PORTB

    Execute:
    Serin2 PinIn,396,[WAIT("X"),SKIP 1, DEC testbyte]
    pause 100
    high PORTB.1
    pause 200
    low PORTB.1
    GOTO Execute
    END

    '============================================

    I want to transmit X90Z where X is the start charachter and Z is the ending char.

    Can anybody guide ?

  2. #2
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    237


    Did you find this post helpful? Yes | No

    Default

    You haven't declared the variable "testbyte".

  3. #3
    uuq1's Avatar
    uuq1 Guest


    Did you find this post helpful? Yes | No

    Default

    Yes, declaring the variable solved my problem.
    Thanks for the help.

Similar Threads

  1. Replies: 18
    Last Post: - 4th July 2017, 14:26
  2. serial communication problem
    By kindaichi in forum Serial
    Replies: 13
    Last Post: - 11th March 2010, 16:37
  3. Replies: 5
    Last Post: - 20th March 2006, 01:34
  4. Serial Communication Problem
    By elec_mech in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 23rd February 2006, 02:11
  5. Replies: 8
    Last Post: - 11th November 2004, 20:08

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