| ??? 11/17/07 20:03 Modified: 11/17/07 20:08 Read: times |
#147137 - Certainly it isnt READ Responding to: ???'s previous message |
Hi again Hans, thanks for your answer.
I mean it every time act as current value was not equal previous, process and send midi, so if controller 1 is in 23 it sends: 23,23,23,23,23,23,23,23,23.... I have certain it is not READ subroutine because it was really working, could even make a presentation with it without problems, the only faulty was sending values twice. I was working on it all day today, and I think I could solve it with really minor change to old code, it is working very well so far. Please can you take a look? I want to thank you and all other people for all help and attention you gave me, so, THANKS. I have changed READ by READADC, on SEND subroutine value on A is shifted(losing LSB)
READ0: CALL READADC ; Read ADC
MOV TH,A
MOV TP,@R0 ; Remember previous value
CLR C
SUBB A,TP ; Current - Previous
JNC ABSEND ; If carry: result was negative, CPL IT!
CPL A
INC A
ABSEND: CJNE A,#2,TRESADC ; Compare change to deadzone
TRESADC:JC INCI ; less than value. ignore
MOV A,TH
SEND0: MOV @R0,A ; Update ram value with new one
CALL SEND
INCI: .............
|



