Kamis, 23 Juni 2016

Program Pascal Procedure Perhitungan IC 555

Program Pascal Procedure Perhitungan IC 555


program Perhitungan_IC_555;
uses crt;

procedure f_TP(f_R1, f_C: real; var result: real);
begin
result := 1.1 * f_R1 * f_C;
end;

procedure f_FR(f_R1, f_R2, f_C: real; var result: real);
begin
result := 1.44 / f_R1 + (2 * f_R2) * f_C;
end;
var

pil, f_R1, f_R2, f_C, rf_TP, rf_FR: real;
begin
clrscr;
writeln('==========================Program Perhitungan IC 555=========================== ');
writeln;
writeln('1. menghitung Timer 555 monostable (Time Pulse) ');
writeln('2. menghitung timer 555 astable (Frequensi) ');
write('masukan pilihan : ');
 readln(pil);

if (pil = 1) then
begin
write('R1 (Resistor1) = ');
readln(f_R1);
write('C (Capasitor) = ');
readln(f_C);

f_TP(f_R1, f_C, rf_TP);
writeln;
writeln('Time Pulse = ', rf_TP:2:2, ' s');
end

else if (pil = 2) then
begin
write('R1 (Resistor1) = ');
readln(f_R1);
write('R2 (Resistor2) = ');
readln(f_R2);
write('C (Capasitor) = ');
readln(f_C);

f_FR(f_R1, f_R2, f_C, rf_FR);
writeln;
writeln(' (Frequensi) = ', rf_FR:2:2, ' Hz');
end
else
begin
writeln('salah input');
end;
readln;

end.







Flowchart