Re: [SLUG] A Challenge....

From: Andrew Wyatt (awyatt@fewt.com)
Date: Wed Dec 18 2002 - 21:17:48 EST


On Wed, 2002-12-18 at 19:55, chris clement wrote:
> I really like the keyboard idea. Talk about a cheap interface! I would use
> two rows of keys with one hooked up to a side array of beam detectors and
> the other to an overhead array. Now we have a grid of, say, 144
> intersections. I think the input buffer will catch all the keystrokes. With
> this little "CAT scan" output, it should be fun to figure out how many fish
> are in the beams together!

Most keyboard buffers are limited in that they won't register more than
6 keys pressed at the same time. (There has been a lot of research done
on the subject in the MAME world.) Capturing a single keystroke is easy,
in perl you would use something like this:

system "stty -echo cbreak </dev/tty >/dev/tty 2>&1";
$cntr=0;
for (;;) {
  eval {
    local $SIG{ALRM}=sub{last;};
    alarm 10;
    $key=getc;
    alarm 0;
    ++$cntr;
    print "Captured char code ".ord($key).", counter is now
".$cntr."\n";
  }
}
system "stty echo -cbreak </dev/tty >/dev/tty 2>&1";

-Andrew

> ----- Original Message -----
> From: "Andrew Wyatt" <awyatt@fewt.com>
> To: <slug@nks.net>
> Sent: Wednesday, December 18, 2002 6:04 PM
> Subject: Re: [SLUG] A Challenge....
>
>
> > On Wed, 2002-12-18 at 16:21, wchast@utilpart.com wrote:
> > > This is a little project I am going to try to take on because
> > > the cost of a device available commercially is off on another
> > > planet.
> > >
> > > My wife has a live bait business, part of that involves delivering
> > > bait fish to bait and tackle shops. She has to count the buggers,
> > > and the count always is off regardless of WHO counts them. I started
> > > looking around for a fish counting device and found one that uses
> > > a optical scanner to count them as they go through a sluice. The optical
> > > part uses IR LED's to illuminate, and the detector or scanner uses
> > > what appears to be a column of detectors on the other side of the
> > > sluice, as a fish goes by it the detectors see the change in IR flux
> > > and can detect when one fish is ahead of the tail of the first fish
> > > thereby not opening all of the optical path.The fish will be anywhere
> > > from 3-6 inches in size.
> > >
> > > The manufacturer of this device wants more than $5K for it, I suppose
> > > that is ok for some government operation that has deep pockets but
> > > at $0.25/fish she will have to catch a lot of fish to pay for it, she
> > > also has to pay a truck used to deliver them and the guy and boat who
> > > actually goes out and catches them.
> > >
> > > The hardware does not look to be that great a deal. It is probably in
> > > the software where the cost is.
> > >
> > > My idea would be to feed the data from the sensors into the parallel
> > > port and read it at a rate such that I get each fish as it goes down
> > > the sluice.
> > >
> > > Now my question is this, do any of you have a idea of where I should
> > > start with this one. The hardware is a no brainer, I can get IR sources
> > > and detector arrays, I can build the sluice and other material, but I
> > > will need to come up with some software that can count the fish as the
> > > go in front of the detector. Has anyone done anything similar in terms
> > > of software?
> > >
> >
> > Why don't you replace an old keyboard key with the IR source/detector
> > and then grab the scancode that gets sent? There has to be a method that
> > will not send a keystroke unless the IR is broken. If you can use a
> > keycode you can have the software in minutes.
> >
> >
> > --
> > Andrew Wyatt <awyatt@fewt.com>
> > FEWT Software - http://www.fewt.com

-- 
Andrew Wyatt <awyatt@fewt.com>
FEWT Software - http://www.fewt.com



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 19:34:45 EDT