Hi leute,
ich bin scho wider. Egal was ich mache es meldt immer einen Fehler beim Compiler.Ich bitte um Hilfe,..
ciao
mac4dac
Program LED_Ausgabe;
Uses crt, DOS;
VAR stelle,wert:byte;
choice: char;
procedure writeport(wert:byte ,stelle:byte);
begin
IF (stelle>=0) AND (stelle<=5)
THEN
begin
stelle1:=stelle shl 1;
port[$37A]:=stelle1;
delay(1);
port[$378]:=wert;
port[$37A]:=stelle1+1;
port[$37A]:=stelle1;
end;
end;
function crewert(w:char):byte;
begin
IF w='0' THEN crewert:=$C0;
IF w='1' THEN crewert:=$F9;
IF w='2' THEN crewert:=$A4;
IF w='3' THEN crewert:=$B0;
IF w='4' THEN crewert:=$99;
IF w='5' THEN crewert:=$92;
IF w='6' THEN crewert:=$82;
IF w='7' THEN crewert:=$F8;
IF w='8' THEN crewert:=$80;
IF w='9' THEN crewert:=$90;
IF w='H' THEN crewert:=$89;
IF w='E' THEN crewert:=$86;
IF w='L' THEN crewert:=$C7;
IF w='O' THEN crewert:=$C0;
IF w=' ' THEN crewert:=$FF;
end;
procedure laufschrift(text:string);
VAR i,j,len :integer;
begin
len:=length(text);
FOR i:=0 TO len DO
begin
FOR j:=0 TO i DO
writeport(crewert(text[i-j])),j);
delay(1000);
end;
end;
procedure spectrum;
VAR i,data :integer;
begin
writeln('Taste fr Abbruch');
Repeat
randomize;
For i:= 0 TO 5 DO
begin
data:=random(3);
IF data=0 THEN writeport($FF,i);
IF data=1 THEN writeport($F7,i);
IF data=2 THEN writeport($B7,i);
IF data=3 THEN writeport($B6,i);
end;
delay(1000);
UNTIL keypressed;
end;
procedure uhr;
Var hour, min, sek, hsek: word;
Begin
writeln('TASTE fr Abbruch');
REPEAT
gettime(hour, min, sek, hsek);
writeport(crewert(chr(hour DIV 10 +48)), 5);
writeport(crewert(chr(hour MOD 10 +48))-$80, 4);
writeport(crewert(chr(min DIV 10 +48)), 3);
writeport(crewert(chr(min MOD 10 +48))-$80, 2);
writeport(crewert(chr(sek DIV 10 +48)), 1);
writeport(crewert(chr(sek MOD 10 +48)), 0);
UNTIL keypressed;
end;
procedure stoppuhr;
Var i: integer;
hsek, sek, min, hsek2, sek2, min2, sek3, min3, x: word;
key: char;
begin
writeln('ENTER fr START');
writeln('ENTER fr STOP');
writeln('a fr Abbruch');
writeport(crewert('0'), 0);
writeport(crewert('0'), 1);
writeport(crewert('0')+$80, 2);
writeport(crewert('0'), 3);
writeport(crewert('0')+$80, 4);
writeport(crewert('0'), 5);
REPEAT
key:=readkey;
IF ord(key) = 13 THEN
Begin
gettime(x, min, sek, hsek);
REPEAT
gettime(x, min2, sek2, hsek2);
IF hsek2>=hsek THEN
hsek2:=hsek2-hsek
ELSE
hsek2:=hsek2+100-hsek;
IF (hsek2>=0) AND (hsek2<=5) THEN
begin
IF sek2>=sek THEN
sek3:=sek2-sek
ELSE
sek3:=sek2+60-sek;
end;
IF (sek3>=0) AND (sek3<=1) THEN
begin
IF min2>=min THEN
min3:=min2-min
ELSE
min3:=min2+60-min;
end;
writeport(crewert(chr(hsek2 MOD 10 + 48)), 0);
writeport(crewert(chr(hsek2 DIV 10 + 48)), 1);
writeport(crewert(chr(sek3 MOD 10 + 48)) +$48, 2);
writeport(crewert(chr(sek3 DIV 10 + 48)), 3);
writeport(crewert(chr(min3 MOD 10 + 48)) +$80, 4);
writeport(crewert(chr(min3 DIV 10 + 48)), 5);
UNTIL keypressed;
readln;
end;
UNTIL key= 'a';
end;
BEGIN
REPEAT
FOR i:=0 TO 5 DO writeport(crewert(' '), i);
clrscr;
writeln('LED-Ausgabe');
writeln;
writeln;
writeln('1 fr Uhr');
writeln('2 fr Stoppuhr');
writeln('3 fr Laufschrift');
writeln('4 fr Spektrum');
writeln('q fr Abbruch');
choice:=readkey;
CASE choise OF
'1': uhr;
'2': stoppuhr;
'3': laufschrift('HELLO ');
'4': spectrum;
UNTIL choise='x';
END.