Driving with
Procedures (TEAM)
In the last problem set you were asked to use the rotation sensors to implement an accurate 90 degree point turn.
Remember that procedures in Ada Mindstorms need to be “nested”:
procedure MyProcedure is
procedure Proc1 is
begin
end Proc1;
procedure Proc2 is
begin
end Proc2;
begin
-- You may use
the nested procedures here.
end MyProcedure;
-- You may change the procedure’s name to whatever the team likes.
procedure Turn_Left_90 is
-- You may change the procedure’s name to whatever the team likes.
procedure Turn_Right_90 is
-- You may change the procedure’s name to whatever the team likes.
-- You may specify the distance however
you wish: by inches, meters, -- turns of the rotation sensor, etc…
procedure Go_Forward(Clicks:Integer) is
procedure Go_Backward(Clicks:Integer) is
Demo: No demo this week. Please make sure your procedures work: They will be VERY important for the upcoming system problem.
Turn in: Turn in
a hardcopy of the team’s code as of Part D as a “Listing.”