Upload
prachee-sharma
View
228
Download
0
Embed Size (px)
Citation preview
7/28/2019 Touch Panel User Guide
http://slidepdf.com/reader/full/touch-panel-user-guide 1/3
How does TouchPanel Work
Touch Panel is an overlay to your NXT screen andprovides coordinates of the point where you touch
the stylus.
The Touch Panel is continuously reading for Stylus
presses. Whenever you need, your program can read from the sensor and
receive the coordinates of the stylus location.It is recommended that you use a Stylus (similar to one used for Nintendo
DS). In absence of stylus a Technic Axle also works well (Pick the longest so you can hold it better).
Connections and Placement
Mounting Touch Panel on your contraption
Attach two ‘Technic Axle Joiner Perpendicular 3L with 4
Pins' (48989)’ (as shown in adjacent picture) to your NXT
on both sides of NXT screen.
Insert three blue ‘Technic Axle Pin
with Friction’ (shown here). PlaceTouch Panel over the NXT Screen and secure in
the blue pins.
Connect Touch Panel to Port 3 of your NXT by using built-in cable.
Programming Techniques
NOTE: Ensure to use latest firmware on your NXT.
NXT-G:
Download the NXT-G blocks available in the NXT-G Blocks
Repository at Mindsensor’s website, at following location:
http://www.mindsensors.com/index.php?
module=documents&JAS_DocumentManager_op=viewDocument&JAS_Document_id=186
Also download sample programs from following location, and modify to suit
your needs.
Copyright © 2011 mindsensors.com 1/3
TouchPanelUser Guide
7/28/2019 Touch Panel User Guide
http://slidepdf.com/reader/full/touch-panel-user-guide 2/3
http://www.mindsensors.com/index.php?
module=documents&JAS_DocumentManager_op=viewDocument&JAS_Document_id=187
NOTE: Gesture data is not available through NXT-G block (The data is a two
dimensional array and there is no direct support for Arrays in NXT-G). If you intend to use Gesture data from the NXTTouchPanel, we suggest you to
use NXC.
NXC:
Download the sample programs and library file available at following location,
and include the library file it in your program by #include directive as:
#include “TP-lib.nxc”
Alternately, you can modify the sample programs to suite your needs.
http://www.mindsensors.com/index.php?module=documents&JAS_DocumentManager_op=viewDocument&JAS_Docu
ment_id=183
I2C Registers:
The Touch Panel appears as a set of registers as follows:
Register Read Write
0x42 X coordinate of current
Stylus touch
-
0x43 Y coordinate of currentStylus touch
-
0x44 Button Presses (one bit for
each button)
Calibration data
0x45 X Coordinate of NXT LCD
Point 1
Also available for writing.
0x46 Y Coordinate of NXT LCD
Point 1
Also available for writing.
0x47 X Coordinate of Touch Panel
Point 1
Also available for writing.
0x48 Y Coordinate of Touch PanelPoint 1 Also available for writing.
0x49 X Coordinate of NXT LCDPoint 2
Also available for writing.
0x4a Y Coordinate of NXT LCD
Point 2
Also available for writing.
0x4b X Coordinate of Touch PanelPoint 2
Also available for writing.
Copyright © 2011 mindsensors.com 2/3
7/28/2019 Touch Panel User Guide
http://slidepdf.com/reader/full/touch-panel-user-guide 3/3
0x4c Y Coordinate of Touch Panel
Point 2
Also available for writing.
Gesture data **
0x4d Size of available data -
0x4e X coordinate of next point -
0x4f Y coordinate of next point -** The Gesture data is a rolling buffer at position 0x4e and 0x4f, read
these locations repeatedly until end of available data. Note that, you shouldread both these locations (X & Y) in a single read operation.
Current Consumption
Average measured current consumption of this device is: 1 mA
I2C Bus address
Factory Default Address: 0x04.
This I2C address can not be changed.
Supported Commands
Command Function
B Change mode to calibrated readings (this is also
default mode)
C Commit the calibrations data to permanent memory.
U Change mode to Un-calibrated readings.
F Restore Touch Panel to Factory Calibration.1-8 Sampling rate for the Gesture chunks (1 being
fastest, and 8 being slowest, default is 4)
Adding your own Overlay for Keys
For your creative application if you require key marks for the key positions,
you can add your own overlays.Download Overlay templates, and instructions from following url:
http://www.mindsensors.com/index.php?
module=documents&JAS_DocumentManager_op=viewDocument&JAS_Docum
ent_id=184
Copyright © 2011 mindsensors.com 3/3