Basic Stamp2 and a Mouse
NWUpgrades
Posts: 292
Does anyone know if there is a way to program the Basic Stamp2 to be used with a mouse or do I need a seperate chip?·The reason I ask is that I have 2 pushbuttons that are controlled via P0 and P1 on my Homework Board and I would like them controlled by a mouse or PushButton.
Comments
I bet many have tried this. Technically its is no more difficult then checking for a pushbutton assuming your mouse is the basic type. I assume mice can vary in architecture but if you look inside you will notice most often micro switches beneath the mouse buttons.
Many projects in stampworks, nuts and volts, etc. use switches. I suggest you go to parallax.com and click "downloads". In the section you will find many examples to give you ideas. You may or may not have to debounce the switch inputs.
http://www.parallax.com/dl/docs/books/sw/exp/sw6.pdf
Post Edited (Jonb) : 3/9/2005 6:57:49 PM GMT
caused by opening or closing the switch. Analogous to striking a bell, it rings or "bounces", it continues to ring trying to establish
an equilibrium. "Debounce" is a way of preventing a false signal. A common way to do this is to simply sample the signal multiple
times or wait for an extended period after we know that an event has taken place and sample again.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe - Mask Designer III
National Semiconductor Corporation
(Communication Interface Division)
500 Pinnacle Court, Suite 525
Mail Stop GA1
Norcross,GA 30071
The PAK-XI Mouse Co-processor is the easiest solution for using a computer mouse for positioning feedback if that's your purpose in using it. Here is a link to the chip:
http://www.awce.com/pak11.htm
If you're using it just for the button facility both the mouse and the co-processor are probably overkill. A couple of normally open pushbutton switches would do the job quite nicely and at a lot less cost.
Regards,
Bruce Bates
You've been asking about interfacing a mouse directly to a BS2. You didn't mention the PC with VGA display (and probably Windows?) in the middle, that the mouse is actually connected to.
I agree with the others -- a picture is definitely needed here. Make sure you include ALL devices you expect to be in your design.
Right now it sounds like you want a BOX, with SWITCHES on top, which will drive two STEPPER MOTORS through a BS2. In addition, you want a SERIAL CONNECTION to a PC which has a MOUSE and DISPLAY running WINDOWS. You want to be able to control your STEPPER MOTORS either with the SWITCHES on the BOX, or by CLICKING on some GRAPHIC (up-down arrows). This should send a MESSAGE to the BS2 to control the STEPPER MOTORS.
In design, coming up with a complete statement of what you want the solution to be is half of the battle. The things you've left out so far include the SERIAL CONNECTION, the entire PC, and the graphics program on the PC. All of these things are doable, but it's really hard to give you advice that helps if we don't know all the pieces you want to use.
You can test the stamp aand stepper motor setup first by getting 4 buttons from radio shack or wherever, forget about the mouse during this stage, concentrate on getting the stepper to respond the way you want when pressing each of the buttons, after you get it working properly, you can write the computer program and the serial interface on the stamp.
This is actually the best method of developing any system in general, the more your capable of breaking a large task into smaller tasks, you can concentrate getting the smaller subsystems right before trying to make the system more complex, when you know the code for each subsystem is working properly, and you experience problems in the larger system, you know it isn't the subsystem, because you already tested it, it will most likely be in the code you use to tie the subsystems together.