28029 Parallax Inc, 28029 Datasheet - Page 241

KIT PARTS SMART SENSORS W/TEXT

28029

Manufacturer Part Number
28029
Description
KIT PARTS SMART SENSORS W/TEXT
Manufacturer
Parallax Inc
Datasheet

Specifications of 28029

Accessory Type
Parts Kit
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
BASIC Stamp® or Javelin Modules
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
Other names
28029PAR
' -----[ Subroutine - Display_Data ]------------------------------------------
Display_Data:
Your Turn - Datalogging Rotation Angle
Chapter 3, Activity #5 introduced vertical rotation measurements with the accelerometer.
Since binary radians are values from 0 to 255, you can store a single angle measurement
in one EEPROM byte. This will double the number of measurements the application will
take. It only takes a few modifications to DatalogAcceleration.bs2 to make it store
rotation angle instead. Here's how:
NEXT
FREQOUT 4, 200, 4000
DEBUG CR, "End of records.",
DEBUGIN char
RETURN
DEBUG CR, "Index
FOR eeIndex = Records TO RecordsEnd STEP 2
NEXT
DEBUG CR, "Press Enter for menu..."
DEBUGIN char
RETURN
x = (x MIN 1875 MAX 3125) - 1875 ** 10538
y = (y MIN 1875 MAX 3125) - 1875 ** 10538
WRITE eeIndex, x
WRITE eeIndex + 1, y
READ eeIndex, x
x = x - 100
READ eeIndex + 1, y
y = y - 100
DEBUG DEC eeIndex, CRSRX, 7, SDEC x, CRSRX, 14, SDEC y, CR
Save DatalogAccleration.bs2 as DatalogAngle.bs2.
Update the comments in the Title section.
CR, "Press Enter for menu..."
CR, "-----
CR
x-axis
------
y-axis",
------",
Chapter 6: Accelerometer Projects · Page 229

Related parts for 28029