Islamic Prayer Times - lookup table
Also, for smart_storm's problem, described above, an example can be as below.
Example: Starting from today,16.02.2006, prayer time table for the next 30 days for location: Los Angeles/USA is as below (actual times). Let say these times and dates are in an eeprom.
(six times instead of five times are given)
Date-----Time1,Time2,Time3,Time4,Time5,Time6
-------------------------------------------------
16.02.2006 5 08 6 32 12 14 15 17 17 44 18 58
17.02.2006 5 07 6 31 12 14 15 17 17 45 18 59
18.02.2006 5 06 6 30 12 14 15 18 17 46 19 00
19.02.2006 5 05 6 29 12 14 15 19 17 46 19 00
20.02.2006 5 04 6 28 12 14 15 19 17 47 19 01
21.02.2006 5 03 6 27 12 14 15 20 17 48 19 02
22.02.2006 5 02 6 26 12 14 15 20 17 49 19 03
23.02.2006 5 01 6 25 12 13 15 21 17 50 19 04
24.02.2006 5 00 6 23 12 13 15 22 17 51 19 04
25.02.2006 4 59 6 22 12 13 15 22 17 52 19 05
26.02.2006 4 58 6 21 12 13 15 23 17 53 19 06
27.02.2006 4 57 6 20 12 13 15 23 17 54 19 07
28.02.2006 4 55 6 19 12 13 15 24 17 54 19 08
01.03.2006 4 54 6 17 12 12 15 24 17 55 19 09
02.03.2006 4 53 6 16 12 12 15 25 17 56 19 09
03.03.2006 4 52 6 15 12 12 15 25 17 57 19 10
04.03.2006 4 50 6 14 12 12 15 26 17 58 19 11
05.03.2006 4 49 6 12 12 12 15 26 17 59 19 12
06.03.2006 4 48 6 11 12 11 15 27 17 59 19 13
07.03.2006 4 47 6 10 12 11 15 27 18 00 19 13
08.03.2006 4 45 6 09 12 11 15 27 18 01 19 14
09.03.2006 4 44 6 07 12 11 15 28 18 02 19 15
10.03.2006 4 43 6 06 12 10 15 28 18 03 19 16
11.03.2006 4 41 6 05 12 10 15 29 18 04 19 17
12.03.2006 4 40 6 03 12 10 15 29 18 04 19 18
13.03.2006 4 39 6 02 12 10 15 29 18 05 19 18
14.03.2006 4 37 6 01 12 09 15 30 18 06 19 19
15.03.2006 4 36 5 59 12 09 15 30 18 07 19 20
16.03.2006 4 35 5 58 12 09 15 30 18 08 19 21
17.03.2006 4 33 5 57 12 09 15 31 18 08 19 22
If you check the table carefully, minutes sometime shift for 2 and 3 minutes; not for one minute everyday; or they do not change for two-three days. Lets not think about this part much, unlike the previous post, as they will be prepared to be read.
Given the table, smart_storm can write a clock code and match the hour and minute with the lookup table from eeprom.
For instance, on date 16.02.2006, Time1=5:08 (actualy 05:08 morning time) so that we can store this in time1 and time1x variables as 05 and 08 respectively.
Time1 holds the hour and time1x holds the minute from eeprom lookup table.
If we also use an RTC chip such as DS1302 for instance, and hold the hour and minute in variables DShour and DSminute then we can come up with a sample concept as below.
DShour var byte 'variable: hour from DS1302
DSminute var byte 'variable: minute from DS1302
time1 var byte ' variable: one of six times in a day to store hour from eeprom lookup table.
time1x var byte 'variable: the sister variable of time1 variable to store the minute from eeprom lookup table.
time2 var byte 'other time etc..
time2x var byte '...etc
.....etc.
loop:
gosub read_ds1302 'codes for reading DS1302...
gosub read_eeprom 'codes for reading eeprom lookup table....
gosub do_convertion 'HEX and DEC convertions are done...
If DShour=time1 AND DSminute=time1x then GOSUB buzzer 'to match the time from DS1302 with the time from eeprom, and ifthey match buzz the buzzer.
goto loop
Hope this post and the previous one can help people write a code for prayer times.
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
Bookmarks