
Spin Lesson 2: Quick Review
- Applications are downloaded to either Propeller RAM only or RAM and EEPROM.
- Those in RAM will not survive power cycling or resetting the Propeller chip.
- Those in EEPROM are loaded into RAM on boot-up in approximately 1½ seconds.
- To download the current object to:
- RAM only: press F10 or select Run → Compile Current → Load RAM + Run.
- RAM + EEPROM: press F11 or select Run → Compile Current → Load EEPROM + Run.
- Spin language:
- Method means “procedure” or “routine.”
- PUB Symbol declares a public method called Symbol. Every object must contain at least one public (PUB) method.
- DIRA is the direction register for I/O pins 0-31. Each bit sets the corresponding I/O pin’s direction to input (0) or output (1).
- OUTA is the output state register for I/O pins 0-31. Each bit sets the corresponding I/O pin’s output state to low (0) or high (1).
- Registers can use indexes, like [16], to access individual bits within them.
- ~~ following a register/variable sets its bit(s) high.
- ! preceding a value/register/variable sets its bit(s) opposite their current state.
- REPEAT creates a loop structure.
- WAITCNT creates a delay
- Indention at the start of lines:
- indicates they belong to the preceding structure; it is required for lines following conditional or loop commands (like REPEAT). (Indenting is optional after block indicators, such as PUB.)
- Ctrl+I toggles visible block-group “structure” indicators on and off.
