130-28029 Parallax Inc, 130-28029 Datasheet - Page 205
130-28029
Manufacturer Part Number
130-28029
Description
KIT PARTS SMART SENSORS
Manufacturer
Parallax Inc
Datasheet
1.122-28029.pdf
(340 pages)
Specifications of 130-28029
Accessory Type
Education Kit
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
BASIC Stamp®
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
- Current page: 205 of 340
- Download datasheet (5Mb)
How BubbleGraph.bs2 Works
The first thing the Main Routine does is display the background character at the current
cursor position. With a 50 ms pause, it completes the “off” portion of a blinking asterisk.
Next, the program acquires the x and y tilt.
The program needs to scale and offset the x and y-axis tilt measurements so that the
asterisk is correctly placed in the Debug Terminal.
introduced in Chapter 3, Activity #3 works for this task.
accelerometer’s pulse values of 1875 to 3125 have to be scaled to asterisk placements of
0 to 20. By subtracting 1875 from the accelerometer measurement before scaling, we
have an input scale of 0 to 1250 (1251 elements) and an output scale of 0 to 20 (21
elements). The equation for calculating the
Substituting the number of elements in the input and output scales gives us a
constant of 1101.
A similar process results in a
code for scale and offset for both axes is:
ScaleConstant = Int[65536(output scale elements)/(input scale elements - 1)]
ScaleConstant = Int[65536(21/(1251-1))]
ScaleConstant = Int[65536(21/1250)]
ScaleConstant = Int[1101.0048]
ScaleConstant = 1101
' Replace asterisk with background character.
index = (22 * y) + x + 1
READ index, char
DEBUG CRSRXY, x, y, char
PAUSE 50
' Measure tilt.
PULSIN 6, 1, x
PULSIN 7, 1, y
' Calculate cursor position.
x = (x MIN 1875 MAX 3125) - 1875 ** 1101
y = (y MIN 1875 MAX 3125) - 1875 ** 576
y = 10 - y
**
scale constant of 576 for the y-axis, and the resulting
**
Chapter 5: Accelerometer Gaming Basics · Page 193
scale constant is:
' Coordinates -> EEPROM address
' Get background character
' Display background character
' Pause for blink effect
' Get Ax and Ay
The same scaling and offset
' Calculate x position
' Calculate y position
For the x-axis, the
**
scale
Related parts for 130-28029
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
Part Number:
Description:
KIT PROPELLER EDU PROJECT PARTS
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
KIT PARTS PROCESS CONTROL
Manufacturer:
Parallax Inc
Datasheet:
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:
Microcontroller Modules & Accessories DISCONTINUED BY PARALLAX
Manufacturer:
Parallax Inc
Part Number:
Description:
BOOK UNDERSTANDING SIGNALS
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
BOARD EXPERIMENT+LCD NX-1000
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
IC MCU 2K FLASH 50MHZ SO-18
Manufacturer:
Parallax Inc
Datasheet: