Skip to content
  • Home
  • Account
  • Restricted content
  • OBEX
  • Chips Tips
  • Logout
  • Shop
  • Blog
Propeller OBEX
  • OBEX
  • Forum
Login
Propeller OBEX

Spin Language Reference

  • Spin Quick Reference

Block Designators

  • VAR
  • Blocks
  • CON

Propeller 1

  • How to pause in PASM
  • How to choose between VAR and DAT
  • WAITPEQ and WAITPNE with PASM
  • IO pin manipulation using PASM
  • Control IO pins from any cog
  • 3D Models for Parallax Products
  • Implementing Abstract Data Structures with Spin Objects
  • Making in USA - The Parallax 8 core microcontroller
  • Simultaneous pin group control
  • Programming the FLiP module over WiFi
  • Keep any value in range
  • Handy Diagnostic Heartbeat
  • Customer Code Deployment in one click

Propeller 2

  • Floating point operators in SPIN2
  • 64/96/128-Bit Unsigned Integer Math
  • 3D Models for Parallax Products
  • DEBUG Plot Layer and Crop
  • Floating point
  • Getting Started Video Tutorials
  • Using the counter for timeouts
  • asmclk and the automatic clock setter
  • Sharing variables between SPIN2 and PASM2
  • Keep any value in range
  • Determine pin state - High, Low or Floating?
View Categories
  • Home
  • Docs
  • Spin Language Reference
  • Spin Quick Reference

Spin Quick Reference

Reading Time: < 1 min read

Terms #

  • Expression - Any combination of symbols that can represent a value.

Constants #

Constants are named values that cannot change. They work like integers, but if a value is used often enough, using constants makes your code easier to read and modify.

Constants are declared in CON blocks.

CON
    DOZEN = 12

Variables #

Variables are named values that can change. All variables in Spin consist of integers of different sizes.

nametypeunsigned rangesigned range
byte8-bit integer0 - 255-128 - 127
word16-bit integer0 - 65,535-32,768 - 32,767
long32-bit integer0 - 4,294,967,295-2,147,483,648 - 2,147,483,647

Variables are created in a VAR block. They are initialized to zero by the compiler.

VAR
    byte    foo
    word    bar
    long    baz

Flow Control #

Indentation #

If Statements #

Loops #

All loops in Spin use the REPEAT command.

Data #

Was this useful ?
Share This Article :
  • Facebook
  • X
  • LinkedIn
Still stuck? How can we help?

Still stuck? How can we help?

Updated on February 20, 2025
Table of Contents
  • Terms
  • Constants
  • Variables
  • Flow Control
    • Indentation
    • If Statements
    • Loops
  • Data

Copyright © 2025 - Parallax Inc.
599 Menlo Drive | Rocklin, CA 95765 | USA