PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Serial Mouse im Progamm aus lesen



NumberFive
03.04.2004, 19:26
Hallo Leute habe ein progamm zu auslesen ein serialen mouse geschrieben. Das habe ich deshalb gemacht damit ich die Normale
mouse immer noch habe. Um den pc zu bedienen. Leide funktionier die Mouse anders als ich dachte waber es geht. die Mouse zeig nur die stärke der richtung änderung an. Hätte gedacht sie zählt. aber zu ermitel wie weit der robi gefahren ist sollte das genügen.

NumberFive
03.04.2004, 20:24
Soory beim aus werten der richtig stimmt was nicht

aber vielleicht kann jemand helfen

Mouse Hardware
by Tomi Engdahl
Serial mouse

Voltage levels:
Mouse takes standard RS-232C output signals (+-12V) as its input signals.
Those outputs are in +12V when mouse is operated. Mouse takes some current
>from each of the RS-232C port output lines it is connected (about 10mA).
Mouse send data to computer in levels that RS-232C receiver chip in the
computer can uderstand as RS-232C input levels. Mouse outputs are normally
something like +-5V, 0..5V or sometimes +-12V. Mouse electronics
normally use +5V voltage.


Microsoft serial mouse

Pins used:
TD, RTS and DTR are used only as power source for the mouse.
RD is used to receive data from mouse.

Serial data parameters: 1200bps, 7 databits, 1 stop-bit

Data packet format:
Data packet is 3 byte packet. It is send to the computer every time
mouse state changes (mouse moves or keys are pressed/released).

D7 D6 D5 D4 D3 D2 D1 D0

1. X 1 LB RB Y7 Y6 X7 X6
2. X 0 X5 X4 X3 X2 X1 X0
3. X 0 Y5 Y4 Y3 Y2 Y1 Y0

The byte marked with 1. is send first, then the others. The bit D6
in the first byte is used for syncronizing the software to mouse
packets if it goes out of sync.

LB is the state of the left button (0 means pressed down)
RB is the state of the right button (0 means pressed down)
X7-X0 movement in X direction since last packet (signed byte)
Y7-Y0 movement in Y direction since last packet (signed byte)

NumberFive
04.04.2004, 01:09
nun geht es wie gewünscht ma sind mäuse empfindlich zu mindestens die
dich zum testen hatte ein problem ist drin wenn man bei mir die dritte
maus tase drückt schieben sich die bits dann kommt das prg nicht mit klar aber mir reicht das so