{pgm test AIR modifie BM 19-9-97}
{OK avec Ulysse et
subaquasys avec dispositif air}
program testlpm;
uses crt,lpm16,dspwxms;
const
GAIN =32; {32 a l'origine}
d : array[0..7] of byte =
(1,1,1,1,1,1,1,1);
var
c : char;
nc,datain : byte;
fin,er,canon : boolean;
tete : word;
begin
clrscr;
repeat until ctrlok;
ferme_canal;
canon := false;
fin := false;
repeat
affdataout(10,10);
if
repok then
begin
datain := get_appui+1;
gotoxy(10,11);
clreol;
write('reponse ',datain);
end;
tete
:= get_adcval(0,er);
gotoxy(10,12);
clreol;
write('tete ',tete);
if
(finwave=0) and canon then
begin
ferme_canal;
canon := false
end;
if
keypressed then
begin
c := readkey;
if (c in ['1'..'8']) then
begin
nc := ord(c)-ord('0');
apneeon;
delay(1000);
apneeoff;
ouvre_canal(nc-1);
canon := true;
jouewave('su400',GAIN,GAIN);
end
else fin := true
end
until fin;
ferme_canal;
end.