28029 Parallax Inc, 28029 Datasheet - Page 303

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
' -----[ Subroutines - Disp_Cust_Char ]---------------------------------------
' This subroutine displays a custom character.
' be set to either Line0 or Line1, and the cursor variable can be set
' to a value between 0 and 15.
' LCD's custom characters and should be set to a value between 0 and 7.
Disp_Cust_Char:
Your Turn - Graphical Two-Axis Tilt Display
Indicating tilt with the TwoAxisBarDisplay.bs2 involves
the accelerometer's x and y axis measurements. It also requires scaling and offset to fit
the accelerometer measurements into a vertical scale of 31 and a horizontal scale of 17.
The horizontal scale also has to be reversed. Figure 7-5 shows how the accelerometer's x
and y axes relate to the LCD's horizontal and vertical axes. Note that that the direction of
the positive y-axis points away from the direction that values increase on the LCD's
horizontal axis. Whenever the scaled y-axis value is 16, the display should show 0, and
whenever the scaled y-axis value is 0, the display should show 16. The way to correct
this is to use a command that subtracts the scaled y-axis value from 16. Essentially, this
boils down to
SELECT cursor
RETURN
SEROUT LcdPin, T9600,
RETURN
CASE 0 TO 7
CASE 8
CASE 9 TO 16
ENDSELECT
GOSUB Disp_Cust_Char
cursor = 7
GOSUB Disp_Cust_Char
cursor = 8
GOSUB Disp_Cust_Char
cursor = cursor - 1
GOSUB Disp_Cust_Char
cursor = cursor + 1
[line + cursor, custChar]
cursor
= 16 − (scaled y value).
The custChar variable selects one of the
Chapter 7: LCD Bar Graphs for Distance and Tilt · Page 291
' Print custom character
' Cursor 0 to 7, no changes
' Cursor 8, display at 7 & 8
' Cursor 9 to 16, display 1 left
The line variable can
PULSIN
commands to acquire

Related parts for 28029