122-32000 Parallax Inc, 122-32000 Datasheet - Page 104
![MANUAL PROPELLER](/photos/8/99/89977/mfg_122-32000_sml.jpg)
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: 104 of 438
- Download datasheet (5Mb)
Exercise 4: Output.spin – Parameters, Calls, and Finite Loops
Our current object from Exercise 3 is interesting, but still isn’t very flexible; after all, the
Toggle
more flexible and also give it the ability to toggle a specific, finite number of times. Look at
the following example and edit your code to match. We’ve crossed out the elements that
should be removed, and highlighted every new element.
{{Output.spin
Toggles Pin with Delay clock cycles of high/low time.}}
Toggles two pins, one after another.}}
CON
PUB Main
PUB Toggle(Pin, Delay, Count)
''Toggle Pin forever
{Toggles I/O pin given by Pin and waits Delay system clock cycles
in between each toggle.}
{{Toggle Pin, Count times with Delay clock cycles in between.}}
Compile and download this application to see the results. The LED on pin 16 should blink
five times (10 toggles) with 1/4th second durations and intervals, then it will stop and the
LED on pin 17 will blink ten times (20 toggles) at 1/6th second durations and intervals.
In this example we removed the constant (
made some minor modifications to the
actual pin-toggling action, but the
Page 104 · Propeller Manual v1.0
Pin
Delay = 3_000_000
Toggle(16, 3_000_000, 10) 'Toggle P16 ten times, 1/4 s each
Toggle(17, 2_000_000, 20) 'Toggle P17 twenty times, 1/6 s each
dira[Pin]~~
repeat Count
!outa[Pin]
waitcnt(Delay + cnt)
method only works with a specific pin and delay. Let’s make the
= 16
Main
Toggle
{ I/O pin to toggle on/off }
{ On/Off Delay, in clock cycles}
'Set I/O pin to output direction
'Repeat for Count iterations
' Toggle I/O Pin
' Wait for Delay cycles
method tells it when and how to do so.
CON
method. The
) block, added a new method called
Toggle
method still performs the
Toggle
Main
method
, and
Related parts for 122-32000
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
![122-27400](/photos/8/99/89964/mfg_122-27400_tmb.jpg)
Part Number:
Description:
MANUAL FOR SUMOBOT
Manufacturer:
Parallax Inc
Datasheet:
![122-28176](/photos/8/99/89965/mfg_122-28176_tmb.jpg)
Part Number:
Description:
GUIDE STUDENT PROCESS CONTROL
Manufacturer:
Parallax Inc
Datasheet:
![122-28029](/photos/8/99/89971/mfg_122-28029_tmb.jpg)
Part Number:
Description:
GUIDE STUDENT SMART SENSORS
Manufacturer:
Parallax Inc
Datasheet:
![HW-FLYLEADS](/photos/8/95/89575/hw-flyleads_tmb.jpg)
Part Number:
Description:
LEAD WIRES FLYING CABLE III/IV
Manufacturer:
Xilinx Inc
Datasheet:
![HW-USB-FLYLEADS-G](/photos/8/95/89577/hw-usb-flyleads-g_tmb.jpg)
Part Number:
Description:
BOARD ADAPTER AND FLY LEADS
Manufacturer:
Xilinx Inc
Datasheet:
![HW-USB-II-G](/photos/8/95/89581/hw-usb-ii-g_tmb.jpg)
Part Number:
Description:
PLATFORM CABLE USB II
Manufacturer:
Xilinx Inc
Datasheet:
![HW-CRII-PM-ACC-G](/photos/8/98/89837/hw-crii-pm-acc-g_tmb.jpg)
Part Number:
Description:
KIT STARTER COOLRUNNER-II BUNDLE
Manufacturer:
Xilinx Inc
Datasheet:
![30008](/images/manufacturer_photos/0/5/515/parallax_inc_tmb.jpg)
Part Number:
Description:
Microcontroller Modules & Accessories DISCONTINUED BY PARALLAX
Manufacturer:
Parallax Inc
![30008](/images/manufacturer_photos/0/5/515/parallax_inc_tmb.jpg)
Part Number:
Description:
Microcontroller Modules & Accessories DISCONTINUED BY PARALLAX
Manufacturer:
Parallax Inc
![70009](/photos/26/92/269208/70009-l_tmb.jpg)
Part Number:
Description:
BOOK UNDERSTANDING SIGNALS
Manufacturer:
Parallax Inc
Datasheet:
![28135](/images/manufacturer_photos/0/5/515/parallax_inc_tmb.jpg)
Part Number:
Description:
BOARD EXPERIMENT+LCD NX-1000
Manufacturer:
Parallax Inc
Datasheet:
![SX18AC/SO](/images/manufacturer_photos/0/5/515/parallax_inc_tmb.jpg)
Part Number:
Description:
IC MCU 2K FLASH 50MHZ SO-18
Manufacturer:
Parallax Inc
Datasheet: