Using Propeller Objects
Most of the Propeller examples, demos and other code rely on objects. Objects are code blocks used in the Propeller development process to extend program functionality.
An object is composed of one or more files; all of the files are contained in a folder, to make it easier to manage them. The object folders are then placed within the file structure of the Propeller Tool, so that the software can find and use them.
Some objects are included with the Propeller Tool software, and others must be manually added in order to compile and upload the program).
Objects Included with Propeller Tool
A number of commonly used objects are included in the Propeller Tool software download. To use one of these objects, you must reference it within the OBJ section of the program. The reference is in the form ObjectName : ObjectFilename, such as
OBJ PST : "FullDuplexSerial"
This adds the FullDuplexSerial.spin object, and names it PST.
You can omit the .spin file extension.
Object names are user-defined, but they must be unique, and cannot conflict with any programming keywords reserved by the Spin language.
Some object files reference other object files. In your program you need only reference the top object file. The Propeller Tool software handles all the remaining references, as needed.
Using Objects From Other Sources
Additional objects are available from Parallax and others, and are used to extend and enhance your Propeller programming experience. The files for these objects are most commonly placed in the same folder as the main program file. If the object is composed of several files, all the files must be present.
When an object is required to compile a KickStart example, either the object file(s) is included with the example, or a link is provided so you can download the object directly from its source.
Note: Most objects are distributed in zip or other self-contained archive files. You must unpack (decompress) the zip file before you can use the object.
For More Information
- The Propeller Object Exchange Library offers over 600 Propeller objects, sorted by category