122-32000 Parallax Inc, 122-32000 Datasheet - Page 92

MANUAL PROPELLER

122-32000

Manufacturer Part Number
122-32000
Description
MANUAL PROPELLER
Manufacturer
Parallax Inc
Datasheets

Specifications of 122-32000

Accessory Type
Manual
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With/related Products
Propeller Education (PE) Kit
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Exercise 1: Output.spin – Our First Object
The following is a simple object, written in Spin, that will toggle an I/O pin high and low
repeatedly. Start the Propeller Tool software and enter this program into the editor. We’ll
explain how it works in a moment. Make sure the “
edge of the edit pane) and pay very close attention to each line’s indention; it’s important for
proper operation.
PUB Toggle
While indentation is critical, capitalization is not.
However, throughout this book, reserved words appear in bold all-captials, except in code
snippets and excerpts, to help you become familiar with them.
After checking that you’ve typed it in properly, press the F10 key (or select Run → Compile
Current → Load RAM + Run from the menu) to compile and download our example
program. If the program you entered is syntactically correct and the Propeller chip is
properly powered and connected to the PC, you should see a “Propeller Communication”
dialog appear momentarily on the screen, like the one in Figure 3-7, and now the LED on I/O
pin 16 of the Propeller chip should be blinking about twice per second. What we just
accomplished is what is shown at the top of Figure 3-4: Downloading on page 89.
What really happened was probably too fast to see because the example program we entered
is so small. When you pressed F10 it caused the Propeller Tool to compile the source code
you entered and turn it into a Propeller Application. The Propeller Tool then searched for a
Propeller chip connected to the PC and downloaded the application into its RAM. Finally,
the Propeller started running the application from RAM, blinking the LED on I/O pin 16.
Page 92 · Propeller Manual v1.0
dira[16]~~
repeat
!outa[16]
waitcnt(3_000_000 + cnt)
PUB
” line begins in column 1 (the leftmost
Propeller code is not case-senitive.
Figure 3-7: Propeller
Communication
Dialog

Related parts for 122-32000