27297 Parallax Inc, 27297 Datasheet - Page 224
27297
Manufacturer Part Number
27297
Description
KIT STAMPWORKS WITH BS2-IC
Manufacturer
Parallax Inc
Datasheet
1.27297.pdf
(230 pages)
Specifications of 27297
Lead Free Status
Contains lead
Product
Microcontroller Accessories
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Available stocks
Company
Part Number
Manufacturer
Quantity
Price
- Current page: 224 of 230
- Download datasheet (3Mb)
I/O Pins are Variables Too
Remember that I/O pins are variables (INS and OUTS) and when doing simple
scanning there is no need to use an intermediary variable. Instead of:
… you can declare an input with the PIN type declaration and do it directly:
I don’t typically advocate putting multiple statements on a single line, but this is one
of those cases (an empty DO-LOOP) where it is the cleaner approach.
We can extend this with
count the number of times two discrete inputs are both high while running a loop.
Here’s the Power PBASIC style for doing that:
This works because we want to add one to the count variable when both buttons are
pressed.
parenthetical statement to zero or one, and the only time one will be returned is
when both buttons are pressed (assuming active-high inputs).
You Can do Fractions with the */ and ** Operators
The */ and ** operators allow the BASIC Stamp to multiply by fractional values.
The result will of course be an integer, but these operators will still simplify the
process, and oftentimes improve the accuracy of the result (over standard multiply
and divide techniques).
Main:
StartBtn
Main:
Count_Buttons:
DO
LOOP WHILE (startStatus = 1)
DO : LOOP WHILE (StartBtn = 1)
btnCount = 0
FOR idx = 1 TO 250
NEXT
By combining Btn1 and Btn2 with a logical AND we reduce the
startStatus = IN3
btnCount = btnCount + (Btn1 & Btn2)
PAUSE 40
combinatorial logic
PIN
3
. Let’s say, for example, that you want to
Related parts for 27297
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
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:
COMPETITION RING FOR SUMOBOT
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
TEXT INFRARED REMOTE FOR BOE-BOT
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
BOARD EXPERIMENT+LCD NX-1000
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
CONTROLLER 16SERVO MOTOR CONTROL
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
BASIC STAMP LOGIC ANALYZER
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
IC MCU 2K FLASH 50MHZ SO-18
Manufacturer:
Parallax Inc
Datasheet: