27220 Parallax Inc, 27220 Datasheet - Page 159
27220
Manufacturer Part Number
27220
Description
BOOK STAMPWORKS
Manufacturer
Parallax Inc
Datasheet
1.27220.pdf
(230 pages)
Specifications of 27220
Accessory Type
Booklet
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
StampWorks
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Not applicable / Not applicable
- Current page: 159 of 230
- Download datasheet (3Mb)
The value for the constant Scale is determined empirically. After constructing the
circuit, insert appropriate DEBUG statements to display the raw potentiometer
readings from both sides (they may not match exactly due to component
differences). Take the lower of the two values and divide that into 500 (desired
output). Convert this fractional value to the */ operand by multiplying by 256.
Example:
The difference between the two scaled RCTIME values is added to the centering
position of 1500 (microseconds). Remember that on the BASIC Stamp 2 module,
PULSOUT works in two-microsecond units. What this means is that the pulse width
value needs to be divided by two in order to create the correct pulse output for the
servo. This is done by using the */ with the PwAdj constant set to $0080 (0.5).
This program demonstrates that the BASIC Stamp does indeed work with negative
numbers. You can see the value of sPos by inserting this line after the calculation:
Negative numbers are stored in two’s complement format. The SDEC (signed
decimal) modifier prints standard decimal with the appropriate sign.
Challenge
Replace the potentiometer with two photocells and update the code to cause the
servo to point toward at the brightest light source.
Can you think of a method that uses two potentiometers and two servos to create a
sun tracker?
Raw RCTIME value:
DEBUG Home, "Position: ", SDEC sPos, "
645
250 / 645 = 0.775
0.775 x 256 = 198 (this is the value called Scale)
"
Related parts for 27220
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: