New PBP user


Closed Thread
Results 1 to 7 of 7

Thread: New PBP user

  1. #1
    Join Date
    Oct 2005
    Location
    Pinckney, Michigan
    Posts
    91

    Default New PBP user

    I'm a new PBP user and am porting a large program from another basic compiler.

    In PBP I'm not clear as to how to fill a numeric array, then later refer to it specifically in OWOUT commands.

    The code below is how it is done in the previous compiler

    Sensor0 bytetable $28,$9e,$50,$1b,$00,$00,$00,$85 'DS18B20 ID code
    OWOUT w1,1,[MatchROM,STR Sensor0\8,ReadScratch] 'send ID code

    Can someone on the forum please jot down the equivalent PBP code here?

    TIA

  2. #2
    Join Date
    Jul 2005
    Posts
    65


    Did you find this post helpful? Yes | No

    Smile

    Hello

    [quote]
    SensorID VAR BYTE[8] 'DS18B20 ID array

    ' DS18B20 ID intialization
    SensorID[0] = $28
    SensorID[1] = $9E
    \/
    \/
    \/
    SensorID[7] = $85

    For the OWOUT command, you better read about it in the manual....

    bye

  3. #3
    Join Date
    Oct 2005
    Location
    Pinckney, Michigan
    Posts
    91


    Did you find this post helpful? Yes | No

    Default

    So then, a FOR/NEXT loop and a LOOKUP table is the most practical way to do this PBP?

    for i = 1 to
    LOOKUP 1, [$28,$9e,$50,$1b,$00,$00,$00,$85], sensor0
    next i

  4. #4
    Join Date
    Jul 2005
    Posts
    65


    Did you find this post helpful? Yes | No

    Default

    your option is time consuming while looking for that value...

  5. #5
    Join Date
    Oct 2005
    Location
    Pinckney, Michigan
    Posts
    91


    Did you find this post helpful? Yes | No

    Default

    I'm not looking for a value, I'm just trying to load the array, so that I can subsequently refer to in my OWOUT command ("Sensor\8" indicated below).

    OWOUT w1,1,[MatchROM,STR Sensor0\8,ReadScratch] 'send ID code
    Last edited by J. Mark Wolf; - 1st November 2005 at 14:25.

  6. #6
    Join Date
    Oct 2005
    Location
    Pinckney, Michigan
    Posts
    91


    Did you find this post helpful? Yes | No

    Default Please tell me there is a better way!

    I am finally able to fill my string array but it is UGLY! The following code works, but it barks!

    for x = 0 to 3
    lookup x,["0",".","0","0"],y
    RevLevString(x) = y 'load string array with "0.00"
    next x
    '
    for x = 0 to 19
    lookup x,["O","C","T"," ","2","5",","," ","2","0","0","5"," ","9",":","2","5","p","m"," "],y
    RevDateString(x) = y 'load str array with "OCT 25, 2005 9:25pm"
    next x

    A competing product accomplishes the same thing as follows:

    RevLevString bytetable "0.96"
    RevDateString bytetable "OCT 01, 2005 7:25pm "

    Is there a more elegant way to fill a string array in PBP?

  7. #7
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    You can also load your string by storing it in Program Codespace (several threads on this forum on this topic), or by storing it in internal or external EEPROM. Again a small For/Next Loop will accomplish the loading.

Similar Threads

  1. PBP Book
    By Bruce in forum Off Topic
    Replies: 83
    Last Post: - 4th October 2021, 12:55
  2. Compiler differences between PBP 2.33 & 2.46
    By nikopolis in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd May 2006, 19:01
  3. Some initial help for a first time PBP user
    By jtburnham in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 29th April 2006, 07:32
  4. Newby- PBP wont compile for 18F (MPLAB)
    By jd76duke in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th December 2005, 23:30
  5. User Configuration Interface in PBP
    By Radiance in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 7th February 2004, 08:00

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