serin,serout


Closed Thread
Results 1 to 7 of 7

Thread: serin,serout

Hybrid View

  1. #1
    Join Date
    Jun 2006
    Posts
    20


    Did you find this post helpful? Yes | No

    Unhappy the ofending code

    here is the example code

    ' SERIN & SEROUT Commands
    '
    ' Upper case serial filter.

    Include "modedefs.bas" ' Include serial modes

    SO con 0 ' Define serial out pin
    SI con 1 ' Define serial in pin
    B0 var byte

    loop: Serin SI,N2400,B0 ' B0 = input character
    If (B0 < "a") or (B0 > "z") Then print ' If lower case, convert to upper
    B0 = B0 - $20
    print: Serout SO,N2400,[B0] ' Send character
    Goto loop ' Forever

    thanks for any help

  2. #2
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    425


    Did you find this post helpful? Yes | No

    Default

    I would try something like this:

    Include "modedefs.bas" ' Include serial modes

    SO var portb.0 ' Define serial out pin <-------You have to define a port
    SI var portb.1 ' Define serial in pin <--------You have to define a port
    B0 var byte

    loop:
    Serin SI,396,[B0]' B0 = input character
    If (B0 < "a") or (B0 > "z") Then ' If lower case, convert to upper
    B0 = B0 - $20
    endif
    Serout SO,396,[B0] ' Send character <------You don't need print command
    Goto loop ' Forever


    Try this and see what happens.

    Chris

  3. #3
    Join Date
    Jun 2006
    Posts
    20


    Did you find this post helpful? Yes | No

    Smile finally the truth

    finally the write code for serin\out thanks for all your help

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