28560 Parallax Inc, 28560 Datasheet - Page 16

Interface Modules & Development Tools Mouse Sensor Kit

28560

Manufacturer Part Number
28560
Description
Interface Modules & Development Tools Mouse Sensor Kit
Manufacturer
Parallax Inc
Datasheet

Specifications of 28560

Interface Type
Serial
Operating Supply Voltage
5 V
Product
Interface Modules
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
' DumpAll outputs the contents of all the sensor chip's registers.
DumpAll:
' ReadAddr reads a sensor chip register.
'
'
ReadAddr:
Copyright © Parallax Inc.
#ELSE
#ENDIF
addr = DX
GOSUB ReadAddr
x = x + dat
IF (dat & NEG) THEN x = x + $ff00
addr = DY
GOSUB ReadAddr
y = y + dat
IF (dat & NEG) THEN y = y + $ff00
addr = QLTY
GOSUB ReadAddr
q = dat
#IF (USE_DEBUG) #THEN
#ELSE
#ENDIF
RETURN
SEROUT 16, baud, [HOME]
FOR addr = 0 TO $7f
NEXT
SEROUT 16, baud, [CR]
RETURN
#IF (NEG_CLK) #THEN
ELSEIF (dat & OFLOW) THEN
ENDIF
IF (dat & CHNG = 0) THEN
ELSEIF (dat & OFLOW) THEN
ENDIF
DEBUG HOME, "x: ", SDEC5 x, " y: ", SDEC5 y, " quality: ", DEC3 q
IF (ovfl) THEN
ENDIF
DEBUG CLREOL
SEROUT 16, baud, ["x", SDEC x, " y", SDEC y, " q", DEC q, CR]
GOSUB ReadAddr
IF (addr & 15 = 0) THEN SEROUT 16, baud, [HEX2 addr, ": "]
SEROUT 16, baud, [HEX2 dat]
IF (addr & 15 = 15) THEN
ELSEIF (addr & 7 = 7) THEN
ELSE
ENDIF
Inputs:
Outputs: dat
DEBUG HOME, "x: ", SDEC5 x, " y: ", SDEC5 y, " quality: ", DEC3 q
RETURN
ovfl = 10
SEROUT 16, baud, ["x", SDEC x, " y", SDEC y, " q", DEC q, CR]
RETURN
SEROUT 16, baud, ["x", SDEC x, " y", SDEC y, " q999", CR]
ovfl = ovfl - 1
DEBUG " OVERFLOW"
SEROUT 16, baud, [CR]
SEROUT 16, baud, ["
SEROUT 16, baud, [" "]
addr = address ($00 - $7F) to read.
= contents of the addressed register.
"]
Mouse Sensor Kit (#28560)
v1.0 6/1/2010 Page 16 of 18

Related parts for 28560