1 Ada Watch
4 Coding and Results
Read moreWith BBC micro:bit, it is Easy and Fast to deploy Codes.
This project shows how the Watch can run with Ada.
2 IDE and HardwareFirst GNAT compiler community shall be installed first.
The the BBC Micro:bit shall be put into the waist watch.
Here is the core part of the code in main.adb,
------------------------------------------------------------------------------
-- Ada Watch
------------------------------------------------------------------------
with Ada.Real_Time;use Ada.Real_Time;
with Display;
procedure Main is
type My_time is range 0 .. 59;
my_second : My_time := 0;
my_minutes : My_time := 0;
type My_hours is range 0 .. 23;
my_hour : My_hours := 0;
txt : String :=" ";
sep : String :=":";
D : Time_Span := Seconds (1);
Next : Time := Clock + D;
begin
loop
for my_hour in 1 .. 24 loop
for my_minutes in 1 .. 60 loop
--Delays(60);
for my_second in 1 .. 60 loop
-- my_second :=K;
delay until Next;
-- txt :=My_time'Image(my_second);
-- Display.Scroll_Text (my_minutes'Img &sep & my_second'Img & sep & my_hour);
end loop;
-- my_minutes := J;
end loop;
-- my_hour :=I;
end loop;
--Display.Scroll_Text (txt);
end loop;
end Main;
Comments