Re: A86: keyboard input problem/question [reposted]


[Prev][Next][Index][Thread]

Re: A86: keyboard input problem/question [reposted]




The problem is that it never stabilizes... I can hold it down for a minute
and it won't turn to a Y or Z or whatever for much more than three
consecutive characters (i.e. YZZYZYZYZYYZZZYZ) The other weird thing about
this is that it happens for only Y and Z... would that be part of the
circuitry? 

-- Stephen Horne

On Wed, 6 Jan 1999, Joshua J Seagoe wrote:

> 
> ok, um...  when you press a key, the switch doesn't turn straight on,
> like
> _______/^^^^^^^^^   (imagine an electrical signal, low to high)
> it does this:
> ______/^^\__/^\___/^^^^^^
> because of lots of things that i don't entirely understand :)
> this is called "bouncing"
> i'm really not sure, the ti's curcuitry might automatically handle this
> and you're getting something else, but i wouldn't think so
> so, to debounce, you wait for it to stabalize into one state or the other
> for sufficiently long before you report it.  set up a loop and count
> down, checking the state, if it changes before the countdown is done,
> reset and ignore it.  if it stays the same all that time, report the
> change in key state.
> 
> i hope you will be less confused by this explanation than i am :)
> 
> -josh
> 
> On Wed, 6 Jan 1999 12:40:45 -0500 "Stephen Horne" <SHorne@Erols.com>
> writes:
> >
> >Thanks, that's a good idea.. but what's debouncing? :-) I guess I 
> >could just
> >check for those keys seperately too.
> >
> >
> >
> >>
> >>that sounds like you need to debounce it.  i'm not exactly sure how 
> >to
> >>fix this, but try putting in a small delay after you check the key.  
> >i
> >>think what you want is to wait for the key to be down for a certain
> >>amount of time before it counts as being down and the same for when 
> >it's
> >>released.  that way, if it's down for less than that, ignore it.
> >>
> >>-josh
> >>
> >>On Tue, 5 Jan 1999 13:15:15 -0500 "Stephen Horne" <SHorne@Erols.com>
> >>writes:
> >>>
> >>>
> >>>I am trying to make an input routine which can determine the 
> >current
> >>>status
> >>>of the keyboard without pausing the keyboard. This is necessary in
> >>>the
> >>>program I am making -- I want there to be a blinking cursor (not 
> >the
> >>>default
> >>>system one.)
> >>>
> >>>The algorithm I made so far works pretty well (except for the
> >>>repetition of
> >>>characters -- I think I can fix that pretty easily, though,) 
> >however,
> >>>when
> >>>you press Y it will show "YZYZYZYZYYZZYZ" etc and if you press Z, 
> >it
> >>>shows
> >>>"Z Z ZZZ  Z  Z    Z" etc. Does anyone know how to fix this?
> >>>
> >
> >
> >
> 
> ___________________________________________________________________
> You don't need to buy Internet access to use free Internet e-mail.
> Get completely free e-mail from Juno at http://www.juno.com/getjuno.html
> or call Juno at (800) 654-JUNO [654-5866]
> 


References: