Spin computer language

From Wikipedia, the free encyclopedia

Spin is a high level computer language created by Parallax, Inc. for their line of Propeller microcontrollers.

Contents

[edit] Syntax

The syntax of Spin can be broken down into blocks. The blocks are as following.

[edit] VAR

Holds global variables

[edit] CON

Holds program constants

[edit] PUB

Holds code for a sub-routine

[edit] OBJ

Contains code for objects

[edit] Keywords

reboot: causes the microcontroller to reboot

waitcnt: wait for an amount of clock cycles

COGINIT: starts a processor on a new task

[edit] sample code

This code sets a pin high (1)

PUB Start

DIRA[0]~~ 'sets pin 0 to input

OUTA[0]~~ 'sets pin 0 high