[A83] Re: Checking how long a key is pressed
[Prev][Next][Index][Thread]
[A83] Re: Checking how long a key is pressed
> var_set: ; label that sets the
> increasing variable to be 10
> ld a,10
> ld (increasingvar),a
> get_increase_amount: ; loop that checks for keypress
> ld a,(increasingvar)
> cp 35 ; if increasingvar = 35,
jump
> to analyze label
> jp z,analyze_increased_amount
> inc a ; increase increasingvar
> ld (increasingvar),a
> ld a,kReset
> out (1),A
> ld a,Group7
> out (1),A
> in a,(1)
> cp k2nd
Should this be get_increase_amount?
> jr z,get_height ; if 2nd is pressed, loop back
> and increase again
> analyze_increased_amount: ; we would end up here if 2nd wasn't
pressed
> (*stuff that analyzes*)
I imagine that your problem is that the counter is way too small. Unless
you have substantial delays between increments, the counter will reach the
max value very quickly. There is no way you could press the key for such a
short period of time.
Follow-Ups:
References: