28122 Parallax Inc, 28122 Datasheet - Page 279

KIT WHAT'S A MICRO:PARTS ONLY

28122

Manufacturer Part Number
28122
Description
KIT WHAT'S A MICRO:PARTS ONLY
Manufacturer
Parallax Inc
Datasheet

Specifications of 28122

Accessory Type
Parts Kit
Product
Microcontroller Accessories
Core Processor
PIC16C57c
Flash
128 Bytes
Operating Supply Voltage
9 V
Board Size
31 mm x 16 mm
For Use With/related Products
Board of Education Full Kit
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
LOOP
Your Turn – Changing the Rate and Condensing the Code
You can increase or decrease the rate at which the LED gets brighter and dimmer by
changing the
You can also use a command called
changes the state of a BASIC Stamp I/O pin. If the I/O pin was sending a high signal,
TOGGLE
makes it send a high signal.
' What's a Microcontroller - DigitalPotUpDownWithToggle.bs2
' Sweep digital pot through values.
' {$STAMP BS2}
' {$PBASIC 2.5}
DEBUG "Program Running!"
counter
FOR counter = 0 TO 127
NEXT
PULSOUT 6, 1
PAUSE 10
makes it send a low signal. If the I/O pin was sending a low signal,
Modify and re-run the program using
rate that the LED gets brighter and dimmer.
Repeat for
Save DigitalPotUpDown.bs2 as DigitalPotUpDownWithToggle.bs2.
Modify the program so that it looks like the one below.
Run the program and verify that it functions the same as the
DigitalPotUpDown.bs2.
Compare the number of lines of code it took to do the same job.
Running out of program memory is a problem many people encounter when their BASIC
Stamp projects get large and complicated. Using
is just one example of many techniques that can be used to do the same job with half the
code.
PAUSE
VAR
command’s
PAUSE 5
Byte
.
Duration
TOGGLE
argument.
to make this program simpler.
PAUSE 20
TOGGLE
and note the difference in the
instead of two
FOR…NEXT
TOGGLE
TOGGLE
loops

Related parts for 28122