910-90005 Parallax Inc, 910-90005 Datasheet - Page 18

KIT BASIC STAMP-PORTABLE DEVICE

910-90005

Manufacturer Part Number
910-90005
Description
KIT BASIC STAMP-PORTABLE DEVICE
Manufacturer
Parallax Inc
Series
BASIC Stamp®r
Type
Education Kitr
Datasheet

Specifications of 910-90005

Contents
Board, cable, components, manual and temperature sensor
For Use With/related Products
BASIC Stamp® 2 and Board of Education
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
The first thing we'll do is create a report on what's happening. We start with
DEBUG
blinkVal
DEBUG
Then we'll print
see what's going on inside of
Finally, we'll use the value of
This line of code uses the
position it under the proper bit by subtracting the current
will print seven spaces, then the pointer. When
idea.
Now that we know what's going on, let's make it happen. The line of code that actually controls the LED uses
another advanced feature of the PBASIC language: variable modifiers. In this program we're using
Without an index (the value in parenthesis),
point at all bits, starting with zero and ending with seven, we will use the index. The index value is and offset into
the variable from bit zero. So,
And, finally, there is a very short
sending the report to the
Wow, that was quite and interesting program for simply blinking an LED, wasn't it. If you're still not quite sure how
it works, don't worry, it will set in with time and we will review these techniques in other projects.
Test Your Knowledge
If the forward voltage of the LED is 1.7 volts, what is the current through the LED with the total series resistance
of 440 ohms (220 + 220)?
Parallax, Inc. • BASIC Stamp HomeWork Board ver 1.1
and
cursor [not visible] to move to the first row, first column of the screen. Next we'll print out the values of
window with attempt to display the characters defined by their current value – that's not what we want.
blinkBit
blinkVal
using the
again, this time using the
DEBUG
REP
DEC
blinkBit
blinkVal
LowBit(0)
modifier to repeat a character. In our case we going to repeat a space. We
PAUSE
screen takes some time as well and contributes to the overall loop timing.
modifier to specify their display as decimal numbers. If we leave
to position a pointer under the current
. As its value changes we'll be able to see the corresponding bits change.
points to bit zero,
so we can see the LED blink when we’re on the low bits. In actuality,
LowBit
blinkBit
BIN
will always point to bit zero of a variable. Since we want to
modifier so that we see it as a binary value. Now we can
is one, it will print six spaces then the pointer. You get the
blinkBit
LowBit(1)
value from seven. When
points to bit one and so on.
blinkVal
DEBUG
bit that is controlling the LED.
Home which causes the
blinkBit
is zero, this line
DEC
LowBit
out, the
Page 18
.

Related parts for 910-90005