Shop OBEX P1 Docs P2 Docs Learn Events
VGA_Keyboard_Demo — Parallax Forums

VGA_Keyboard_Demo

Brian RileyBrian Riley Posts: 626
edited 2007-01-31 04:53 in Propeller 1
In the course of beating donw the bugs in my PRC-VGIO board in both the PS2 connections and the VGA connections, I needed sothing that tested both together. I took the library demos VGA_Text and Keyboard_Demo (which uses the TV output) and combined them to make what amounst to be ing VGA_Keyboard_Demo. I also renamed the Keybaord_Demo to TV_Keybaord_Demo, to make the differences obvious.

Anyway, I thought someone else might find it useful. The changes was trivial but no sense in reinventing the wheel!



www.wulfden.org/PRC/

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
cheers ... brian riley, n1bq, underhill center, vermont
See the K107 Serial LCD Controller at
www.wulfden.org/k107/

Comments

  • Richard S.Richard S. Posts: 70
    edited 2007-01-23 23:16
    Brian...

    Thanx for the file...educational for me at my level.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Richard in Michigan
  • Richard S.Richard S. Posts: 70
    edited 2007-01-30 03:37
    I have a·program that continously reads and updates data to video output.· Trying to incorporate keyboard_text_demo.spin is not working.· I think kb.spin is continuously waiting for a keypress and does not allow my screen updates to occur unless a key is pressed.· Would putting the keyboard program into a separate cog and feeding its output to a main memory buffer to be read by the screen update program be the answer?
  • Mike GreenMike Green Posts: 23,101
    edited 2007-01-30 06:03
    Richard,
    You're going to have to supply more information, maybe attach the source file or archive for your program. One of the calls in keyboard.spin (getkey) will wait until a key is pressed. Another call (key) will return a zero if there are no keypresses in the key buffer. There's a call (gotkey) that will return true if there are keypresses in the buffer and false otherwise. It may be that your program is calling getkey where you should be checking for a keypress with gotkey first, updating your display if false or reading the keypress if true.
    Mike
  • Richard S.Richard S. Posts: 70
    edited 2007-01-31 03:56
    Thanx Mike...

    The suggestions you gave were helpful. I can now print to screen the hex equivalent of the keyboard keypress. As you may recall I have been working on Encoder.spin to display to VGA screen. With your help, I am now able to use four encoders, print to screen with fixed decimal point, print + in green and - in red. I still need to calibrate the encoder counts to inches and thousandths of inches, and I would like to reset individual encoders at the very least, using the keyboard. The encoder.spin uses an internal buffer containing the position, updates it then writes it to main memory. Is there anyway I can get to the object encoder.spin internal buffer to modify it?

    I was under the impression that the gray code truth table and quadrature truth table were different. Once I understood that they were the same, and that I did not need to modify encoder.spin, everything worked out very nicely.

    If interested, I can post my work so far.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-01-31 04:53
    Richard,
    There is no way to get to a cog's memory from outside the cog other than to erase it and start over (COGNEW/COGINIT). You could modify the encoder.spin routine to look in main memory (maybe after the area where it copies its values) for updates to its internal buffer, but that's all you can do.
    Typically, you might have a flag byte for each encoder and, if the flag is non-zero, the encoder routine resets the corresponding buffer entry, then zeroes the byte (to indicate to the Spin routine that the reset was done).
    Mike
Sign In or Register to comment.