rozsah od 500 do 3000 ot./min');
write('chcem udrzovat otacky : '); read(otnom);
writeln('Zadajte presnost udrzovanych otacok,(+-;otacky/min.)');
read(tol); closegraph;clrscr;
gd:=0;initgraph(gd,gm,'C:TPBGI');
settextstyle(0,0,3);setcolor(white);
port[$243]:=$89; PA:=120; port[$240]:=PA;
repeat asm
xor bx,bx
mov dx,242h
@1: in al,dx
rcr al,1
jnc @1
@2: in al,dx
rcr al,1
jc @2
@3: in al,dx
inc bx
rcr al,1
jnc @3
mov word ptr otacky,bx
end;
Vypocet skutocnych otacok po aproximacii charakt.z namer.bodov ;
otackys:=round(2420-0.1021*otacky);
regotch:=round((abs(otnom-otackys)/10));
if (otackys-tol)
if PA<1 then PA:=1;
if PA>255 then PA:=255;
port[$240]:=PA; setfillstyle(0,white);
outtextxy(50,40,'pocet otacok za min.');
bar(200,160,492,100);line(10,10,getmaxx,10);
line(getmaxx,10,getmaxx,getmaxy-50);
line(getmaxx,getmaxy-50,10,getmaxy-50);
line(10,getmaxy-50,10,10);
outtextxy(250,100,stri(round(otackys)));
outtextxy(60,180,'Cislo na D/A prevodnik');
outtextxy(60,400,'Reg.odchylka je');
outtextxy(450,400,stri(regotch));
bar(60,220,450,320); bar(450,400,550,420);
outtextxy(250,220,stri(round(PA)));
until keypressed; end.
.