Shop OBEX P1 Docs P2 Docs Learn Events
keyboard interface — Parallax Forums

keyboard interface

supportsupport Posts: 15
edited 2011-03-17 21:32 in Propeller 1
hello, i'm wondering if it is possible for the propeller chip to wait until a 6 digit number is entered in the keyboard and then that initiates the program like sets one of the pins high. Any help would be appreciated. If you can get me the whole code i will be super appreciative.. thanks, Henry

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-03-17 15:25
    It's certainly possible. What kind of Propeller board do you have? What kind of keyboard are you talking about? Do you mean a PS/2 keyboard or the keyboard connected to the PC used for programming the Propeller or what?

    A real easy way to do this is with FemtoBasic or Dongle Basic. The first works with a Propeller with a PS/2 keyboard and either a TV or VGA display connected to an appropriate Propeller board (you don't have to connect a TV or VGA ... the Propeller won't know). Dongle Basic is similar, but is designed to be used with the PC used for programming. A simple program can be used like:

    100 input a
    110 if a <> 123456 then goto 100
    120 outa[5] = 1
    130 goto 100
  • supportsupport Posts: 15
    edited 2011-03-17 16:01
    its actually not even a keyboard, its a handheld barcode scanner that is usb. its completely plug and play and actsas a keyboard input. whatever barcode it scans it displays the numbers on the computer screen acting exactly as a keyboard. the whole idea behind this is if a person buys something at a particular store the receipt will print a barcode on it. with this barcode (a 6 digit number) the consumer can take to our photobooth and scan the receipt. once this is done a high pin on the propeller chip will activate our photobooth to allow them to take a free photo with any purchase. i'm not sure what propeller board to buy to make this happpen, any ideas, we have tons of the prop proto board usb here in the shop. would that work?
  • Mike GreenMike Green Posts: 23,101
    edited 2011-03-17 17:42
    You have a USB client that behaves like a USB keyboard. That's much harder. One of the forum members has been working on a USB driver that could work with a variety of USB devices, but it's not something for beginners. There have to be drivers for the devices that would be plugged in. Theoretically, your barcode reader might work with this driver. I think there's a driver for a mouse and a memory stick. I don't know if there's one for a keyboard yet.

    The only standard keyboard interface for the Propeller that you can just drop into a program is for a PS/2 keyboard.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-03-17 19:18
    Does your barcode scanner have the ability to be plugged into a PC's PS/2 port (with an adapter) and still function? If so, you might still have a chance here. I've encountered a number of scanners in my day job which had downward compatibility to support older computers. Check your specs.

    OBC
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-03-17 20:06
    support,

    Does your barcode scanner have a serial mode?

    I have several of these scanners. There's a barcode in the manual to scan to switch it to serial mode. I had to make a cable to access the serial data. I've described how I did it in the comments on the page I just linked to (I'm ddegn).

    I use a Propeller Proto board to process the information from the barcode scanner. The scanner I have uses 5 V logic so I have the signal from the barcode reader go through a 10k ohm resistor before it gets to the Propeller. This setup works great. I've used it just about everyday for over a year.

    Duane
  • davidsaundersdavidsaunders Posts: 1,559
    edited 2011-03-17 21:32
    Every bar code scanner I have and care to use is PS/2. These are still widely available, and they usually seem to operate more reliably than the serial and or usb devices I have seen (and yes PS/2 is a form of serial).
Sign In or Register to comment.