Shop OBEX P1 Docs P2 Docs Learn Events
Keyboard/Mouse question. — Parallax Forums

Keyboard/Mouse question.

RicardoPRicardoP Posts: 13
edited 2007-09-18 02:42 in Propeller 1
Hello!

I've been thinking about this little project and finally I decided to do it. But there are a couple paths that I could take (probably more but anyway ... ) and I would like to get some advice on.

Basically I need keyboard/mouse input, the gotcha is that it needs to be as fast a possible (meaning I don't want much/any delay between the key press and the time the prop does something with it.

Route a)
Use a ps2 hookup directly to the prop, this would probably give fastest response time.

Route b)
Use a pc, read the kb/mouse data and send it to the prop via serial connection.

Route A seems obvious but Route B has a cool advantage ... I can write a nice front end that would allow remapping of the keys (user presses 'W' for example and the program remaps it to some other key)

Thanks!

Comments

  • Spork FrogSpork Frog Posts: 212
    edited 2007-09-17 22:31
    Obviously the former will be faster. Of course, as well, you can re-map the keys within your program. No one says that "W" actually has to show "W" in the end. Of course, that could mean somewhat large tables of re-mapping. Although, in the end re-mapping on the prop directly would still be easier (I'd think) than trying to do it with a PC. Then it's self-contained as well.
  • RicardoPRicardoP Posts: 13
    edited 2007-09-17 22:36
    Could serial communications be done fast enough that the delay wouldn't be something a human would notice?
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2007-09-17 23:19
    There is no noticable lag when using the keyboard object.

    Graham
  • hippyhippy Posts: 1,981
    edited 2007-09-17 23:52
    It seems overkill to add a PC to do a job the Propeller can. A keyboard lookup table should not be overly large, and it would run far quicker than a PC application routing via serial.

    If you wanted / needed to off-load work from a Propeller, you could always use another Propeller instead of a PC. Far cheaper, more 'planet friendly'.
    RicardoP said...
    Could serial communications be done fast enough that the delay wouldn't be something a human would notice?

    In tests I once did, few perceived a delay between pushing a button and a LED coming on 100mS later. It takes around 20mS for a character received to be shown on a monitor. Serial comms would run far faster than that, so the answer is the delay would not be noticeable.

    Post Edited (hippy) : 9/17/2007 11:59:50 PM GMT
  • AribaAriba Posts: 2,687
    edited 2007-09-18 01:01
    RicardoP said...

    Route b)
    Use a pc, read the kb/mouse data and send it to the prop via serial connection.

    This is exactly was PropTerminal does. Try it out to decide if this way is fast enough for you:
    http://forums.parallax.com/showthread.php?p=649540

    Andy
  • Mark BramwellMark Bramwell Posts: 56
    edited 2007-09-18 01:50
    You could also look at Color-Code.spin that I posted yesterday. You use your PC with hyperterminal at 9600 baud. The I,J,K,M keys each cause the propeller to perform a function on the screen. Is there a delay?

    There 2 versions of the program in the zip file. One uses a PS2 keyboard plugged into the protoboard, the other is serial. I believe those 2 programs should be able to answer your questions.
  • RicardoPRicardoP Posts: 13
    edited 2007-09-18 02:42
    Thanks all for your replies. I will try all the suggestions and see what works best.
Sign In or Register to comment.