Shop OBEX P1 Docs P2 Docs Learn Events
What and Where is pBasic 2.5? — Parallax Forums

What and Where is pBasic 2.5?

Lynn EdwardsLynn Edwards Posts: 2
edited 2007-12-23 06:07 in BASIC Stamp
I have a BOE full kit and am busy with my first project.· I'm having trouble with quite a few pbasic commands not being recognized when running the syntax checker.· All of these non working commands (such as PIN, EXIT, DO WHILE, and several others) have {PBASIC 2.5} listed in the top line of the manual's command description.·All of the commands that work do not have the {PBASIC 2.5} label in the command description.

What exactly is PBASIC 2.5?· Is it the actual interpretive·assembly code·in the micro?· Do I perhaps have a down rev basic stamp module?

Is it the version of the Basic Stamp windows editor?· I'm using version 2.3.9 which is the only version I can find on the parallax web site.

I'm have been able to code around all the commands that don't work by writing the program·using different commands, but it would be nice to be able to use all of the commands.· What do I need to do to install/use PBASIC 2.5?

In case anyone is interested my project is to make a digital threading dial for my lathe so that I can cut metric threads with an english feed screw, while disconnecting the saddle feed half nut between cutting·passes.· With english threads and and english feed screw it is easy to resynchronize the spindle·to feed screw to cut the same thread at each pass with a simple mechanical divider·and rotary dial, and most lathes have these already.· When cutting metric threads it is not practical to use a mechanical synchronizing counter since the lead screw may have to rotate many dozens of times before the spindle and feed screw are lined up again.·Such a synchronizing·indicator would take a very complicated gear train.·With a rotary encoder, some switches,·an LCD readout, and a micro to keep track of the·lead screw·rotation, I·hope to·be able to·accomplish this synchronizing function which will allow me to do metric threading up to·a shoulder, or internal metric threading - something that currently is not possible.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-12-23 05:38
    When PBasic was updated to version 2.5, a number of statements were added like DO, EXIT, etc. To maintain compatibility with the extensive existing code base, the older format was kept as the default. The {$PBASIC 2.5} compiler directive enables the extensions. The current Stamp Editor will compile programs for the BS1 version of Stamp Basic as well as the BS2 pre-2.5 version and the 2.5 version of the syntax. Page 123 of the current manual discusses this.
  • Dennis FerronDennis Ferron Posts: 480
    edited 2007-12-23 05:43
    PBasic 2.5 is the version of the language supported by the most recent Basic Stamp editor programs. It's built in to the program if you have a recent download of it (i.e., less than a few years old). So first make sure you have a recent copy of the Basic Stamp editor.

    The {PBASIC 2.5} comment at the top of the code listings is just a directive telling the Stamp Editor what version of the PBASIC to use for the program. You were meant to actually literally copy that directive into the top of your program. You can also get it inserted by going to one of the menus in the Stamp Editor and selecting what version of PBASIC the program uses. It should be in the same place where you select what kind of Stamp to use. If your Stamp Editor doesn't recognize the directives, it means you're using a version of the editor that is too old. (Are you using the Windows version of the editor, or the DOS version?)

    As far as I know ( - I'm not a Parallax employee, just a fan - ) there were no changes made to the Basic Stamp chips themselves when PBASIC 2.5 was introduced. Instead, everything in version 2.5 is sort of a short-hand to represent things that took more lines or were error prone to write in earlier versions of PBASIC. But at the byte code level, everything in 2.5 compiles down to the same representation as a program in an earlier version of the language, so the Stamp hardware remained the same.
  • Lynn EdwardsLynn Edwards Posts: 2
    edited 2007-12-23 06:07
    Thank you Mike and Dennis. Everything is working now.

    I had actually copied the {PBasic 2,5} compiler directive from an example into the top of my program without really knowing what it did. I thought it was just a comment.

    I left out the "$". After inserting it all is well. I have a lot to learn.

    Thanks again,

    Lynn Edwards
Sign In or Register to comment.