read_temp: IF no_ini_flag=1 THEN RETURN 'if no temp.ini skip reading temperatures. REG %AX,&h8400 'load 84h in AH REG %DX,&h0001 'load 01h in DL CALL INTERRUPT &h15 AX%=REG(%AX) 'port 1 from 1st floor BX%=REG(%BX) 'port 2 from basement CX%=REG(%CX) 'port 3 from second floor DX%=REG(%DX) 'port 4 from breezeway INCR q 'the sample count 'Some game ports only support one joystick, so test all ports. IF AX%<>0 THEN degF1(q)= conv2temp!(AX%,1) 'read the temperature IF BX%<>0 THEN degF2(q)= conv2temp!(BX%,2) IF CX%<>0 THEN degF3(q)= conv2temp!(CX%,3) IF DX%<>0 THEN degF4(q)= conv2temp!(DX%,4) IF auto_test_flag=1 THEN GOSUB show_all_deg 'display house temperatures IF q=4 THEN 'after 4 readings, average the data degF1=(degF1(1)+degF1(2)+degF1(3)+degF1(4))/4 '1st floor degF2=(degF2(1)+degF2(2)+degF2(3)+degF2(4))/4 'basement degF3=(degF3(1)+degF3(2)+degF3(3)+degF3(4))/4 '2nd floor degF4=(degF4(1)+degF4(2)+degF4(3)+degF4(4))/4 'breezeway 'GOSUB save_temp 'now combined with lm335 save_temp q=0 END IF RETURN