Shop OBEX P1 Docs P2 Docs Learn Events
BS2+Seetron''s G12032 graphical LCD+Pak6 + mouse to capture mouse move — Parallax Forums

BS2+Seetron''s G12032 graphical LCD+Pak6 + mouse to capture mouse move

ArchiverArchiver Posts: 46,084
edited 2001-11-30 12:08 in General Discussion
What I would suggest is to put the mouse in remote mode. Then the mouse
remembers a cumulative reading until you ask for it.

Keep in mind the mouse has a sampling rate and it is possible to overrun
that rate even on a PC. Try writing a DOS or Windows program that plots
each point you get from the mouse and then move the mouse rapidly across
the screen. You won't get every point. So if you are moving in the X
axis you might get: (100,50) (110,50) (130,50). The slower you move the
mouse the more points you get.

In remote mode, the movement is relative. So when you ask for a report,
the result is (0,0) if the mouse hasn't moved sine last time you asked.
This is the method used in this program:
http://www.al-williams.com/awce/pak6mou.htm

Good luck!

Al Williams
AWC
* Easy RS-232 Prototyping
http://www.al-williams.com/awce/rs1.htm

>
Original Message
> From: John Leung [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=f6rKzRYUgtik2pUGXo6mVsSJuTIPbQtbt2JmTvk4yeYd9ubqMVvEmzS34Als8JajEk5Fr3KBMuBulkQqCQ]jleung00@n...[/url
> Sent: Friday, November 30, 2001 1:46 AM
> To: basicstamps@yahoogroups.com
> Subject: Re: [noparse][[/noparse]basicstamps] Re: BS2+Seetron's G12032 graphical
> LCD+Pak6 + mouse to capture mouse move
>
>
> Dear All
>
> Thanks for the information, especially that from Al William
> is very useful. The code works. It is only that the speed is
> not fast enough to capture every "movement" of the mouse. I
> am not sure if it is my program not properly designed or it
> is the nature of the LCD.. Most probably it is the program.
>
> To share with all of you, the code as follows. I would be
> very grateful if somebody can suggest the way to improve
> performance. ========================================================
> main:
> gosub getMousePos ' Read mouse position.
> gosub showMousePos ' Display the mouse position as a dot to
> complete the trace. goto main
>
> showMousePos:
> serout 0,n9600,[noparse][[/noparse]ESC,"I",BLACK,ESC,"P",x1+CUT0,y1+CUT0]
> return
>
> getMousePos:
> ......
> 'convert negative number. xreg is a byte (raw x move) from
> the mouse. I need to do conversion for 'negative move. x1 =
> x1 - ((xreg-1)^$FF) IF x1>119 THEN convertx
>
> goto doy
> xplus:
> x1=x1+xreg
> x1=x1 max RMARGIN
>
> doy:
> if ysign=0 then y_up
> 'convert negative number
> y1=y1 + ((yreg-1)^$FF)
> y1=y1 MAX BMARGIN
> goto ydone
> y_up:
> y1=y1-yreg
> IF y1>31 THEN converty
> ydone:
>
> 'debug sdec x1, " ", sdec y1, " ", sdec xreg, " ", sdec yreg,
> cr return
>
> converty: y1=(y1-1)^$FF
> goto ydone
> convertx: x1=(x1-1)^$FF
> goto doy
>
> ========================================================
>
> Thanks a lot.
>
> John Leung
>
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the
> Subject and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
Sign In or Register to comment.