;====开机后,取8次“零点”检测值的平均值, 保存到AD0BUF中===
MOV HEX1,#0
MOV HEX2,HEX1
MOV R1,#08H ;取 8次测量值作为零点值
GETAD0:
LCALL GET_ADC
NOP
NOP
ADD A,HEX1
MOV HEX1,A
MOV A,HEX2
ADDC A,#0 ;假定经过4秒气阀放气后,气压值小于1KPA
MOV HEX2,A
LCALL DLY4 ;----DEBUG---
DJNZ R1,GETAD0
MOV A,HEX2
RRC A
MOV HEX2,A
MOV A,HEX1
RRC A
MOV HEX1,A
MOV A,HEX2
RRC A
MOV A,HEX1
RRC A
CLR C
RRC A
MOV AD0BUF,A
;==================================================
CLR F_MEASURE |