Hello,
I am a first year computing AS student coding a petrol pump program. You can see the specification here. I am a little stuck and I was wondering if anyone could point me in the right direction. I have coded a seven segment display using arrays, procedures, write lines and gotoxy's. You can see my code below.
But I am unsure of how to implement this seven segment display into my code. What I am trying to do is when the program runs I want the display to start running, kind of like a timer. I want the display to increment by 1 from 00.0 to 01.1,02.2,03.3 etc etc but I am unsure of how to implement this. Can someone point me in the right direction ?
PROGRAM segcode;
USES WINCRT;
VAR
seg: array[1..7] of char;
a, b, c, d: integer;
{Fills arrays for 7 segment display}
PROCEDURE segassign;
BEGIN;
seg[1] := '_';
seg[2]:= '|';
seg[3]:= '|';
seg[4]:= '-';
seg[5]:= '|';
seg[6]:= '|';
seg[7]:= '¯';
END;
PROCEDURE numberzero;
BEGIN;
GOTOXY(a+1,b+0);
WRITELN(seg[1]);
GOTOXY(a+0,b+1);
WRITELN(seg[2]);
GOTOXY(a+2,b+1);
WRITELN(seg[3]);
GOTOXY(a+0,b+2);
WRITELN(seg[5]);
GOTOXY(a+2,b+2);
WRITELN(seg[6]);
GOTOXY(a+1,b+3);
WRITELN(seg[7]);
END;
BEGIN
segassign; {Assign Segments}
a:= 30; {provide placements}
b:= 3;
numberzero; {zero}
a:= 34; {provide placements}
b:= 3;
numberzero; {zero}
a:= 38; {provide placements}
b:= 3;
numberzero; {zero}
END.