Jump to content

PBASIC

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by InterwebUsr (talk | contribs) at 00:59, 7 June 2007 (added in Syntax). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

PBASIC is a microcontroller based version of BASIC created by Parallax, Inc.. The language was created to bring ease of use to the microcontroller and embedded processor world. PBASIC is used for writing code for the BASIC Stamp microcontrollers. After the code is written it is tokenized and loaded into an EEPROM on the microcontroller. These tokens are fetched by the microcontroller and used to generate instructions for the processor.

Syntax

When starting a PBASIC file, you define which version of the Basic Stamp, and what version of PBASIC you are using with tags. Variables and constants are usually declared first thing in a program. The DO LOOP, FOR NEXT loop, IF and ENDIF, and some standard BASIC commands are part of the language. However, many commands native to PBASIC like PULSOUT, HIGH, LOW, DEBUG, and FREQOUT are used for special purposes which can't be done in regular BASIC. (Like having the Basic Stamp ring a piezo-speaker)