Programme Mikropascal

2
Programme mikropascal Commentaire program EX5; Nom du prgramme var d,g:byte; Déclaration des variables procedure gauche; begin if ((porta.0=...) and((porta.2=...) or (g=...)) and (d=...)) then g:= ... else g:= ...; if g=... then porta.3:= ... else porta.3:= ...;end; Procédure droite procedure droite; begin if ((porta.0=...) and((porta.1=...) or (d=...)) and (g=...)) then d:= ... else d:= ...; if d=... then porta.4:= ... else porta.4:= ...;end; end; Procédure gauche procedure affichage; begin if ((d=0) and (g=0)) then portb:=119; if d=1 then portb:=116; if g=1 then portb:=120; end; procedure affichage Begin trisa:=%......................; while true do begin droite; gauche; affichage; end. Programme principal Appel de la procédure droite Appel de la procédure gauche

Transcript of Programme Mikropascal

Page 1: Programme Mikropascal

Programme mikropascal Commentaire program EX5; Nom du prgrammevar d,g:byte; Déclaration des variablesprocedure gauche;begin

if ((porta.0=...) and((porta.2=...) or (g=...)) and (d=...)) then

g:= ... else g:= ...; if g=... then porta.3:= ... else porta.3:= ...;end;

Procédure droite

procedure droite; begin

if ((porta.0=...) and((porta.1=...) or (d=...)) and (g=...)) then

d:= ... else d:= ...; if d=... then porta.4:= ... else porta.4:= ...;end; end;

Procédure gauche

procedure affichage; begin if ((d=0) and (g=0)) then portb:=119; if d=1 then portb:=116;

if g=1 then portb:=120; end;

procedure affichage

Begintrisa:=%......................;while true do

begin droite; gauche; affichage; end.

Programme principal

Appel de la procédure droiteAppel de la procédure gauche