16bit variable and degrees conversion


Results 1 to 8 of 8

Threaded View

  1. #7
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Your example data:
    21 AD 34 01 22 EF 23 02

    ===============================================
    ' The code (Not tested)

    my_array VAR BYTE[7] ' Define array variable with 7 locations

    SERIN2 IN_PIN, BAUD,[WAIT("!") STR my_array\7]

    ' Waits for the string "!", then collects the next 7 characters.
    ' (21 HEX = ASCII !)


    ===============================================

    This could be valid data:
    21 21 21 01 22 21 21 02

    Make sure you verify that "01" "22" "02" are in the
    right position in the array.

    * * * * * *

    From PicBasic manual:

    An optional Timeout and Label may be included to allow the program
    to continue if a character is not received within a certain amount of time.
    Timeout is specified in 1 millisecond units. If the serial input pin stays in
    the idle state during the Timeout time, the program will exit the SERIN2
    command and jump to Label.

    * * * * * *

    PicBasic Pro Code that demonstrates the use of modifiers
    with the Serin2 and Serout2 commands.

    http://www.microengineeringlabs.com/...bp/ser2mod.bas


    Luciano
    Last edited by Luciano; - 22nd April 2005 at 11:54.

Similar Threads

  1. Conversion problem
    By eva in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 15th March 2007, 18:21

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