Attempting to download an empty file to the LameStation will generate an error from PropellerIDE.
so here we see the bare minimum that constitutes a Spin program.
Well, that was easy!
This is called a
PUB block, which is short for public function . Functions are areas where you write code that can do stuff. If your code is a sentence, a function is the verb, the action. You can put as many
PUB blocks as you want into a file, but when you run your code, the Propeller will start by running the first public function that appears in the file. From that function, you can call other functions.
PUB First Third PUB Another PUB Third Another
All Spin programs must include at least one
Spin is not case-sensitive.
is the same as
View the complete example at
Bonus Round: Function Names!
Function names can contain letters, numbers, and underscores. However, the first character cannot be a number (that’s good; otherwise, they’d start looking like passwords).