[A83] Re: Official H**s Replacement Commands & Questions & PulseWidthMod


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

[A83] Re: Official H**s Replacement Commands & Questions & PulseWidthModulation




>Er.. silly me.. more than that was wrong with it. =) Halts would have a
>maximum frequency of ~160Hz, which is a pretty low note as Dan said. You
>might want to change the increment by more than 1, though, dunno. This
>should span a pretty large range of frequencies (more than you can hear...)

That could be an idea. But now let's make something clear. It's not for
sound (though it probably could be used for it), but it's for driving a
motor at variable speed.

>
>#define WAIT ei\ halt\ djnz $-2
>begin:
>    ld bc,$8000
>loop:
>    bcall(_getky)
>    cp kDown
>    jr nz,notdown
>    inc bc
>notdown:
>    cp kUp
>    jr nz,notup
>    dec bc
>notup:
>    cp kClear
>    ret z
>    ld a,$C3    ;off
>    out($00),a
>    call wait
>    ld a,$C0    ;on
>    out($00),a
>    ld hl,loop  ;jump to loop when
>    push hl     ;subroutine is done

Why don't just use a 'jp'? And how can this work as a jp?

>wait:
>    ld h,b
>    ld l,c
>waitloop:
>    dec hl
>    ld a,h
>    or l

I don't really understand this, because I'm a very-much beginner.

>    jr nz,waitloop
>    ret
>
>
>-----Original Message-----
>From: assembly-83-bounce@lists.ticalc.org
>[mailto:assembly-83-bounce@lists.ticalc.org]On Behalf Of Dan Weiss
>Sent: Monday, July 02, 2001 7:42 AM
>To: assembly-83@lists.ticalc.org
>Subject: [A83] Re: Official H**s Replacement Commands & Questions &
>PulseWidthModulation
>
>
>
>
>
>
>>From: "Kirk Meyer" <kirk.meyer@colorado.edu>
>>Reply-To: assembly-83@lists.ticalc.org
>>To: <assembly-83@lists.ticalc.org>
>>Subject: [A83] Re: Official H**s Replacement Commands & Questions &
>>PulseWidthModulation
>
>>#define WAIT ei\ halt\ djnz $-2
>>begin:
>>     ld b,0
>>loop:
>>     bcall(_getky)
>>     cp kDown
>>     inc b \ ret
>>     jr nz,notdown
>>notdown:
>
>um... Take a second look at that jr...
>
>>     cp kUp
>>     jr nz,notup
>>     dec b \ ret
>>notup:
>>     cp kClear
>>     ret z
>>     ld a,$C3    ;off
>>     out($00),a
>>     WAIT
>>     ld a,$C0    ;on
>>     WAIT
>>     jr loop
>>
>
>
>_________________________________________________________________
>Get your FREE download of MSN Explorer at http://explorer.msn.com
>
>
>
>