Shop OBEX P1 Docs P2 Docs Learn Events
PS/2 Keyboard with LCD Display interface help — Parallax Forums

PS/2 Keyboard with LCD Display interface help

RussMRussM Posts: 27
edited 2012-12-19 15:30 in Propeller 1
I am looking for some code that interfaces a PS/2 keyboard with Parallax 4x20 LCD Display, preferably something that incorporates FullDuplexSerial.spin. All the code that I found from the website uses other display sources and I am having a hard time converting the code to use an LCD Display. Any help is greatly appreciated!

Comments

  • JonnyMacJonnyMac Posts: 9,108
    edited 2012-12-17 20:43
    There's really no reason to use a cog (via FDS) for the serial display; one never has to transmit much data to it and the Propeller can handle 19.2k in Spin (assuming you're running 80MHz). The attached object is my version of the Parallax LCD object (which I originally wrote when I worked for Parallax).
  • RussMRussM Posts: 27
    edited 2012-12-18 16:38
    Thanks for the advice Jonny. I am not too concerned with using a cog for the serial display because my project will not require more than a few cogs. I am still having trouble integrating the PS/2 keyboard into my project however. Sorry if I sound too needy; I am new to the Spin language and am trying to get the hang of it!

    Edit: I am using the keyboard driven given from http://obex.parallax.com/objects/56/. I am trying to incorporate this driver with FullSerialDuplex.spin. In Keyboard_Demo.spin I have modified the last bit of code to look like this, however all that is being printed to the screen for each key is "\". Would you know why this is happening?
    'echo keystrokes in hex
    repeat
    term.hex(kb.getkey,3)
    TEST := term.out(" ")
    LCD.tx(TEST)

    Double Edit: I modified the code to be as follows and it works fine for values 0-9, now just to get it to print out decimal points and carriage returns.
    'echo keystrokes in hex
    repeat
    LCD.hex(kb.getkey,1)
  • JonnyMacJonnyMac Posts: 9,108
    edited 2012-12-19 15:30
    I'm sure you realize by now that this is illegal code:
    TEST := term.out(" ")
    LCD.tx(TEST)
    


    I whipped up the attached program in about three minutes -- works like a champ.
Sign In or Register to comment.