maï a écrit :
Il faut garder la tempo anti rebond sinon risque de partir dans tout les sens,et la RAZ de la variable Temp_Val et après test si bit 2 égale a 1 si oui alors on est en décomptage, il va de soit, qu'il faut incrémenter cette variable dans int du timer
A+
Bonjour tous le monde
Me revoila
alors j'ai mis dans l'inter l'incrementation de la variable Temp_Val, et un test pour voir si le timer1 a été declenché 4 fois ce qui correspond a un appuis long.
Maï, es ce que ma tempo anti rebond est correcte ? et le reste aussi
Code : Tout sélectionner
;*******************************************************************************
Tbpval
BTFSC BP_Val ;BP_val relaché ? RB1
GOTO Tbpvalsuite ;OUI alors suite
CALL Temp800µs ;petite tempo antirebond
btfss Temp_Val,2 ; test si 4 x timer1
goto Tbpval ; non alors j'attend
goto appuislong ; oui traitement de l'appuis long
Tbpvalrelache
btfsc BP_Val
goto Tbpvalrelache
bsf Index,7
goto Decom
Tbpvalsuite
BCF STATUS,C
rlf Index,f ; rotation par la gauche
btfsc Index,4 ; test si > que ComptMd
goto Init_Va ; oui alors traitement
incf FSR,f ; non alors variable suivante
bsf Index,7 ; garder la main en reglage
goto BouP
appuislong
btfss BP_Val ; bp relaché ?
goto appuislong ; non alors attente
clrf Temp_Val ; raz pour test appuis long
; mon prog si appuis long 400 ms sur bpval
goto BouP
Ps: après publication, je m'aperçois que l'effacement de la variable n'est pas au bon endroit,

désolé, je réfléchi puis je modifierai ce post