122-32000 Parallax Inc, 122-32000 Datasheet - Page 117
122-32000
Manufacturer Part Number
122-32000
Description
MANUAL PROPELLER
Manufacturer
Parallax Inc
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
- Current page: 117 of 438
- Download datasheet (5Mb)
3: Propeller Programming Tutorial
Objects vs. Cogs
It’s important to understand that there is no direct relationship between objects and cogs.
Remember, Exercise 5 used just one object but two cogs and Exercise 6 used two objects and
two cogs, but each of these exercises could have used only one cog if they wanted to process
everything serially.
When and how cogs are used is completely determined by the
application and the developer(s) who wrote it.
Exercise 7: Output.spin – More Enhancements
Let’s add some significant enhancements to our Output object. Currently the
method
Toggle
can be called to toggle a pin serially, or the
method can be called to launch the
Start
Toggle
method as a separate process, to run in parallel. But we haven’t provided a way to stop that
process once it is going or even a way to determine if it’s running in the first place. Also, it
would be nice to have the option of toggling the pin endlessly, in addition to the finite count
feature we already have.
Let’s add a
method to stop the active process and an
method to test whether a
Stop
Active
parallel process is currently running. In addition, we’ll enhance our
method as
Toggle
described above.
For objects like this one, it is a common and recommended convention to use the name
“Start” for a method that activates a new cog and the name “Stop” for a method that
deactivates a cog previously started by that object. This way, while scanning an object in
summary or documentation view, other developers can more quickly understand how to use
your object; when they see
and
they can infer that the object activates/deactivates
Start
Stop
another cog.
For objects that don’t activate another cog but still need some kind of
initialization, it is recommended to use the name “Init” for the key method.
This code is loaded with clever changes; be prepared, it will take a lot to explain it but the
knowledge you’ll gain is well worth it.
Here’s the code; modify yours to match:
Propeller Manual v1.0 · Page 117
Related parts for 122-32000
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
Part Number:
Description:
MANUAL FOR SUMOBOT
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
GUIDE STUDENT PROCESS CONTROL
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
GUIDE STUDENT SMART SENSORS
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
LEAD WIRES FLYING CABLE III/IV
Manufacturer:
Xilinx Inc
Datasheet:
Part Number:
Description:
BOARD ADAPTER AND FLY LEADS
Manufacturer:
Xilinx Inc
Datasheet:
Part Number:
Description:
PLATFORM CABLE USB II
Manufacturer:
Xilinx Inc
Datasheet:
Part Number:
Description:
KIT STARTER COOLRUNNER-II BUNDLE
Manufacturer:
Xilinx Inc
Datasheet:
Part Number:
Description:
Microcontroller Modules & Accessories DISCONTINUED BY PARALLAX
Manufacturer:
Parallax Inc
Part Number:
Description:
Microcontroller Modules & Accessories DISCONTINUED BY PARALLAX
Manufacturer:
Parallax Inc
Part Number:
Description:
BOOK UNDERSTANDING SIGNALS
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
BOARD EXPERIMENT+LCD NX-1000
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
IC MCU 2K FLASH 50MHZ SO-18
Manufacturer:
Parallax Inc
Datasheet: