منيرياسين عضو جديد
عدد المساهمات : 4 نقاط : 6 تاريخ التسجيل : 02/04/2018
| موضوع: طلب مساعدة في اكمال مشروع اوقاة الصلاة الإثنين 02 أبريل 2018, 10:39 pm | |
| ا لسلام عليكماطلب منكم مساعدتي في تعديل الوقت و التاريخ بالازرار باستعمال ال mikrobasic - الكود:
-
program tag dim i ,day ,month_ as byte dim sec,min,hr,week_day,dday,mn,year as short dim oldstate,oldstate1,oldstate2,oldstate3,set1 as byte const seg as byte[10]=(63,6,91,79,102,109,125,7,127,111) dim num as byte[32] sub procedure kanon2() const kanon12 as char[1][32][5]=(( (5,12,2,5,6), (47,15,49,6,22), (47,15,49,7,23), (47,16,50,8,24), (47,16,51,8,24), (47,16,52,9,25), (47,17,52,10,26), (48,17,53,11,27), (48,18,54,12,27), (48,18,55,13,28), (48,18,56,14,29), (48,19,56,15,30), (48,19,57,16,31), (48,20,58,17,32), (47,20,59,18,33), (47,20,0,18,33), (47,21,1,19,34), (47,21,2,20,35), (47,21,3,21,36), (47,22,3,22,37), (46,22,4,23,38), (46,22,5,25,40), (46,22,6,26,41), (45,23,7,27,42), (45,23,8,28,43), (45,23,9,29,44), (44,23,10,30,45), (44,24,11,31,46), (43,24,12,32,47), (43,24,13,33,48), (42,24,13,34,49), (42,24,14,35,50))) if day >=1 then num[0]= kanon12[0][0][1]/10 num[1]=kanon12[0][0][1] mod 10 num[2]= kanon12[0][day][1]/10 num[3]=kanon12[0][day][1] mod 10 num[4]= 0 num[5]=kanon12[0][0][0] mod 10 num[6]= kanon12[0][day][0]/10 num[7]=kanon12[0][day][0] mod 10 num[8]= month_/10 num[9]=month_ mod 10 num[10]= day/10 num[11]=day mod 10 num[12]=hr/10 num[13]=hr mod 10 num[14]= min/10 num[15]=min mod 10 if day <15 then num[16]=0 num[17]=kanon12[0][0][2] mod 10 else num[16]=0 num[17]=(kanon12[0][0][2] mod 10)+1 end if num[18]= kanon12[0][day][2]/10 num[19]=kanon12[0][day][2] mod 10 num[20]= 0 num[21]=kanon12[0][0][3] mod 10 num[22]= kanon12[0][day][3]/10 num[23]=kanon12[0][day][3] mod 10 num[24]= kanon12[0][0][4] div 10 num[25]=kanon12[0][0][4] mod 10 num[26]= kanon12[0][day][4]/10 num[27]=kanon12[0][day][4] mod 10 end if end sub sub procedure kanon1() const kanon11 as byte[1][32][5]=(( (5,12,2,4,6) , (29,0,38,56,11), (30,1,38,56,11), (31,1,38,56,11), (32,2,38,56,11), (31,2,38,56,11), (33,2,38,56,11), (34,3,38,56,11), (34,3,38,56,11), (35,4,38,56,12), (36,4,38,57,12), (36,5,38,57,12), (37,5,39,57,12), (38,6,39,57,13), (38,6,39,57,13), (39,6,40,57,13), (40,7,40,58,13), (40,7,40,58,14), (41,8,41,58,14), (41,8,41,59,15), (42,9,41,59,15), (42,9,42,59,16), (43,10,42,0,16), (43,10,43,0,17), (44,11,43,1,17), (44,11,44,1,18), (45,12,45,2,18), (45,12,45,3,19), (45,13,46,3,19), (46,13,46,4,20), (46,14,47,4,21), (46,14,48,5,21))) if day>=1 then num[0]= kanon11[0][0][1]/10 num[1]=kanon11[0][0][1] mod 10 num[2]= kanon11[0][day][1]/10 num[3]=kanon11[0][day][1] mod 10 num[4]= 0 num[5]=kanon11[0][0][0] mod 10 num[6]= kanon11[0][day][0]/10 num[7]=kanon11[0][day][0] mod 10 num[8]= month_/10 num[9]=month_ mod 10 num[10]= day/10 num[11]=day mod 10 num[12]=hr/10 num[13]=hr mod 10 num[14]= min/10 num[15]=min mod 10 num[16]= 0 num[17]=kanon11[0][0][2] mod 10 num[18]= kanon11[0][day][2]/10 num[19]=kanon11[0][day][2] mod 10 if day <22 then num[20]=0 num[21]=kanon11[0][0][3] mod 10 else num[20]=0 num[21]=(kanon11[0][0][3] mod 10 )+1 end if num[22]= kanon11[0][day][3]/10 num[23]=kanon11[0][day][3] mod 10 num[24]= kanon11[0][0][4]div 10 num[25]=kanon11[0][0][4] mod 10 num[26]= kanon11[0][day][4]/10 num[27]=kanon11[0][day][4] mod 10 end if end sub sub procedure shbat() const shbat1 as byte[1][31][5]= (( (5,12,3,5,6), (41,24,15,36,51), (41,25,16,37,52), (40,25,17,38,53), (39,25,18,40,55), (39,25,19,41,56), (38,25,20,42,57), (37,25,21,43,58), (36,25,21,44,59), (36,25,22,45,0), (35,25,23,46,1), (34,25,24,47,2), (33,25,25,48,3), (32,25,25,49,4), (31,25,26,50,5), (30,25,27,51,6), (29,25,28,52,7), (28,25,29,53,8), (27,25,29,54,9), (26,25,30,55,10), (25,25,31,56,11), (24,25,31,57,12), (23,25,32,58,13), (22,25,33,59,14), (21,25,33,0,15), (20,24,34,1,16), (19,24,35,2,17), (18,24,35,3,18), (17,24,36,3,18), (16,24,36,4,19) )) if day>=1 then num[0]= shbat1[0][0][1]/10 num[1]=shbat1[0][0][1] mod 10 num[2]= shbat1[0][day][1]/10 num[3]=shbat1[0][day][1] mod 10 num[4]= 0 num[5]=shbat1[0][0][0] mod 10 num[6]= shbat1[0][day][0]/10 num[7]=shbat1[0][day][0] mod 10 num[8]= month_/10 num[9]=month_ mod 10 num[10]= day/10 num[11]=day mod 10 num[12]=hr/10 num[13]=hr mod 10 num[14]= min/10 num[15]=min mod 10 num[16]= 0 num[17]=shbat1[0][0][2] mod 10 num[18]= 0 num[19]=shbat1[0][day][2] mod 10 if day <24 then num[20]= 0 num[21]=shbat1[0][0][3] mod 10 else num[20]= 0 num[21]=(shbat1[0][0][3] mod 10 )+1 end if num[22]= 0 num[23]=shbat1[0][day][3] mod 10 if day < 7 then num[24]= shbat1[0][0][4]div 10 num[25]=shbat1[0][0][4] mod 10 else num[24]= shbat1[0][0][4]div 10 num[25]=(shbat1[0][0][4] mod 10 )+1 end if num[26]= shbat1[0][day][4]/10 num[27]=shbat1[0][day][4] mod 10 end if end sub sub procedure aathar() const athar1 as byte[1][32][5]=(( (5,12,3,6,7), (15,24,37,5,20), (16,24,37,6,21), (13,23,38,7,22), (11,23,38,8,23), (10,23,39,9,24), (9,23,39,10,25), (7,22,40,11,26), (6,22,40,12,27), (5,22,41,13,28), (3,22,41,14,29), (2,21,42,14,29), (1,21,43,15,30), (59,21,43,16,31), (58,21,43,17,32), (56,20,44,18,33), (55,20,44,19,34), (54,20,44,20,35), (52,19,45,21,36), (51,19,45,22,37), (49,19,45,23,38), (48,19,46,24,39), (46,18,46,24,39), (45,18,46,25,40), (43,17,47,26,41), (42,17,47,27,42), (40,17,47,28,43), (38,17,48,29,44), (37,16,48,30,45), (35,16,48,30,45), (34,16,48,31,46), (33,15,49,31,46))) if day >=1 then num[0]= athar1[0][0][1]/10 num[1]=athar1[0][0][1] mod 10 num[2]= athar1[0][day][1]/10 num[3]=athar1[0][day][1] mod 10 if day<13 then num[4]= 0 num[5]=athar1[0][0][0] mod 10 else num[4]= 0 num[5]=(athar1[0][0][0] mod 10)-1 end if num[6]= athar1[0][day][0]/10 num[7]=athar1[0][day][0] mod 10 num[8]= month_/10 num[9]=month_ mod 10 num[10]= day/10 num[11]=day mod 10 num[12]=hr/10 num[13]=hr mod 10 num[14]= min/10 num[15]=min mod 10 num[16]= athar1[0][0][2]/10 num[17]=athar1[0][0][2] mod 10 num[18]= athar1[0][day][2]/10 num[19]=athar1[0][day][2] mod 10 num[20]= athar1[0][0][3]/10 num[21]=athar1[0][0][3] mod 10 num[22]= athar1[0][day][3]/10 num[23]=athar1[0][day][3] mod 10 num[24]= athar1[0][0][4]div 10 num[25]=athar1[0][0][4] mod 10 num[26]= athar1[0][day][4]/10 num[27]=athar1[0][day][4] mod 10 end if end sub sub procedure nesan() const nesan4 as byte[1][31][5]=(( (5,12,3,6,7), (31,15,49,32,47), (29,15,49,33,48), (28,14,49,34,49), (26,14,49,35,50), (24,14,50,36,51), (23,13,50,37,52), (21,13,50,38,53), (20,13,50,39,54), (18,12,50,40,55), (17,12,50,41,56), (15,12,51,42,57), (13,12,51,43,58), (12,11,51,44,59), (10,11,51,45,0), (9,11,51,46,1), (7,11,51,46,1), (6,10,52,47,2), (4,10,52,48,3), (3,10,52,49,4), (1,10,52,49,4), (0,9,52,50,5), (58,9,52,50,5), (57,9,53,51,6), (55,9,53,52,7), (54,9,53,53,8), (52,8,53,54,9), (51,8,53,55,10), (50,8,53,56,11), (48,8,53,57,12), (47,8,53,57,12)))
if day >=1 then num[0]= nesan4[0][0][1]/10 num[1]=nesan4[0][0][1] mod 10 num[2]= nesan4[0][day][1]/10 num[3]=nesan4[0][day][1] mod 10 num[4]= nesan4[0][0][0]/10 num[5]=nesan4[0][0][0] mod 10 num[6]= nesan4[0][day][0]/10 num[7]=nesan4[0][day][0] mod 10 num[8]= month_/10 num[9]=month_ mod 10 num[10]= day/10 num[11]=day mod 10 num[12]=hr/10 num[13]=hr mod 10 num[14]= min/10 num[15]=min mod 10 num[16]= nesan4[0][0][2]/10 num[17]=nesan4[0][0][2] mod 10 num[18]= nesan4[0][day][2]/10 num[19]=nesan4[0][day][2] mod 10 num[20]= nesan4[0][0][3]/10 num[21]=nesan4[0][0][3] mod 10 num[22]= nesan4[0][day][3]/10 num[23]=nesan4[0][day][3] mod 10 num[24]= nesan4[0][0][4]/10 num[25]=nesan4[0][0][4] mod 10 num[26]= nesan4[0][day][4]/10 num[27]=nesan4[0][day][4] mod 10 end if end sub sub procedure ayar() const ayar5 as byte[1][32][5]=(( (3,12,3,6,8), (45,8,54,58,13), (44,8,54,59,14), (43,8,54,0,15), (41,7,54,1,16), (40,7,54,2,17), (39,7,54,3,18), (37,7,54,4,19), (36,7,55,5,21), (35,7,55,6,22), (34,7,55,6,23), (33,7,55,7,24), (31,7,55,7,25), (30,7,55,8,26), (29,7,56,9,28), (28,7,56,10,29), (27,7,56,11,30), (26,7,56,12,31), (25,7,56,12,32), (24,7,56,13,33), (23,7,57,14,34), (22,8,57,15,35), (21,8,57,16,36), (20,8,57,16,37), (19,8,57,17,38), (19,8,58,18,39), (18,8,58,19,40), (17,8,58,20,41), (16,8,58,20,42), (16,9,58,21,43), (15,9,59,22,44), (15,9,59,23,45) )) if day >=1 then num[0]= ayar5[0][0][1] div 10 num[1]=ayar5[0][0][1] mod 10 num[2]= ayar5[0][day][1] div 10 num[3]=ayar5[0][day][1] mod 10 num[4]= ayar5[0][0][0] div 10 num[5]=ayar5[0][0][0] mod 10 num[6]= ayar5[0][day][0] div 10 num[7]=ayar5[0][day][0] mod 10 num[8]= month_/10 num[9]=month_ mod 10 num[10]= day/10 num[11]=day mod 10 num[12]=hr/10 num[13]=hr mod 10 num[14]= min/10 num[15]=min mod 10 num[16]= 0 num[17]=ayar5[0][0][2] mod 10 num[18]= ayar5[0][day][2] div 10 num[19]=ayar5[0][day][2] mod 10 if day < 3 then num[20]= 0 num[21]=ayar5[0][0][3] mod 10 else num[20]= 0 num[21]=(ayar5[0][0][3] mod 10 )+1 end if num[22]= ayar5[0][day][3] div 10 num[23]=ayar5[0][day][3] mod 10 num[24]= ayar5[0][0][4] div 10 num[25]=ayar5[0][0][4] mod 10 num[26]= ayar5[0][day][4] div 10 num[27]=ayar5[0][day][4] mod 10 end if end sub sub procedure hazeran() const hazeran6 as byte[1][31][5]=(( (3,12,3,7,8), (14,9,59,23,46), (13,9,59,24,47), (13,9,0,24,48), (12,9,0,25,48), (12,10,0,26,49), (11,10,0,26,50), (11,10,0,27,51), (11,10,1,27,51), (10,10,1,28,52), (10,11,1,28,53), (10,11,1,29,53), (10,11,2,29,54), (10,11,2,30,54), (10,11,2,30,55), (10,12,2,30,55), (10,12,2,31,56), (10,12,3,31,56), (10,12,3,31,56), (10,12,3,32,57), (10,13,3,32,57), (10,13,4,32,57), (10,13,4,32,57), (10,13,4,32,57), (11,13,4,33,57), (11,14,4,33,57), (11,14,4,33,57), (12,14,5,33,57), (12,14,5,33,57), (13,14,5,33,57), (13,15,5,33,57))) if day>=1 then num[0]= hazeran6[0][0][1]div 10 num[1]=hazeran6[0][0][1] mod 10 num[2]= hazeran6[0][day][1] div 10 num[3]=hazeran6[0][day][1] mod 10 num[4]= 0 num[5]=hazeran6[0][0][0] mod 10 num[6]= hazeran6[0][day][0] div 10 num[7]=hazeran6[0][day][0] mod 10 num[8]= month_/10 num[9]=month_ mod 10 num[10]= day/10 num[11]=day mod 10 num[12]=hr/10 num[13]=hr mod 10 num[14]= min/10 num[15]=min mod 10 if day < 2 then num[16]= 0 num[17]=hazeran6[0][0][2] mod 10 else num[16]= 0 num[17]=(hazeran6[0][0][2] mod 10)+1 end if num[18]= hazeran6[0][day][2] div 10 num[19]=hazeran6[0][day][2] mod 10 num[20]= 0 num[21]=hazeran6[0][0][3] mod 10 num[22]= hazeran6[0][day][3]div 10 num[23]=hazeran6[0][day][3] mod 10 num[24]= hazeran6[0][0][4] div 10 num[25]=hazeran6[0][0][4] mod 10 num[26]= hazeran6[0][day][4] div 10 num[27]=hazeran6[0][day][4] mod 10 end if end sub sub procedure tammoz() const tammmoz7 as byte[1][32][5]=(( (3,12,3,7,8), (14,15,5,33,57), (14,15,5,33,57), (15,15,6,32,56), (15,15,6,32,56), (16,15,6,32,56), (17,16,6,32,55), (17,16,6,31,55), (18,16,6,31,54), (19,16,6,31,54), (20,16,6,31,53), (20,16,6,30,53), (21,16,6,30,52), (22,16,6,29,52), (23,17,7,29,51), (24,17,7,28,50), (25,17,7,28,49), (26,17,7,27,49), (27,17,7,27,48), (28,17,7,26,47), (29,17,6,25,46), (30,17,6,25,45), (31,17,6,24,44), (32,17,6,23,43), (33,17,6,23,42), (34,17,6,22,41), (35,17,6,21,40), (36,17,6,20,39), (37,17,6,19,38), (38,17,5,19,37), (39,17,5,18,36), (40,17,5,17,35) )) if day>=1 then num[0]= tammmoz7[0][0][1]/10 num[1]=tammmoz7[0][0][1] mod 10 num[2]= tammmoz7[0][day][1]/10 num[3]=tammmoz7[0][day][1] mod 10 num[4]= tammmoz7[0][0][0]/10 num[5]=tammmoz7[0][0][0] mod 10 num[6]= tammmoz7[0][day][0]/10 num[7]=tammmoz7[0][day][0] mod 10 num[8]= month_/10 num[9]=month_ mod 10 num[10]= day/10 num[11]=day mod 10 num[12]=hr/10 num[13]=hr mod 10 num[14]= min/10 num[15]=min mod 10 num[16]= tammmoz7[0][0][2]/10 num[17]=tammmoz7[0][0][2] mod 10 num[18]= tammmoz7[0][day][2]/10 num[19]=tammmoz7[0][day][2] mod 10 num[20]= tammmoz7[0][0][3]/10 num[21]=tammmoz7[0][0][3] mod 10 num[22]= tammmoz7[0][day][3]/10 num[23]=tammmoz7[0][day][3] mod 10 num[24]= tammmoz7[0][0][4]/10 num[25]=tammmoz7[0][0][4] mod 10 num[26]= tammmoz7[0][day][4]/10 num[27]=tammmoz7[0][day][4] mod 10 end if end sub sub procedure aab() const aab8 as byte[1][32][5]=(( (3,12,4,7,8), (41,17,5,16,33), (42,17,5,15,32), (43,17,4,14,31), (44,17,4,13,30), (45,17,4,12,29), (47,17,4,11,27), (48,17,3,10,26), (49,16,3,9,25), (50,16,3,8,23), (51,16,2,6,22), (52,16,2,5,21), (53,16,1,4,19), (54,16,1,3,18), (55,16,1,2,17), (56,15,0,1,16), (57,15,0,59,14), (59,15,59,58,13), (0,15,59,57,12), (1,15,58,56,11), (2,14,58,54,9), (3,14,57,53,8), (4,14,56,52,7), (5,14,56,50,5), (6,13,55,49,4), (7,13,55,48,3), (8,13,54,46,1), (9,13,53,45,0), (10,12,53,44,59), (11,12,52,43,58), (12,12,51,42,57), (13,12,50,40,55))) if day>=1 then num[0]= aab8[0][0][1]/10 num[1]=aab8[0][0][1] mod 10 num[2]= aab8[0][day][1]/10 num[3]=aab8[0][day][1] mod 10 num[4]= aab8[0][0][0]/10 num[5]=aab8[0][0][0] mod 10 num[6]= aab8[0][day][0]/10 num[7]=aab8[0][day][0] mod 10 num[8]= month_/10 num[9]=month_ mod 10 num[10]= day/10 num[11]=day mod 10 num[12]=hr/10 num[13]=hr mod 10 num[14]= min/10 num[15]=min mod 10 num[16]= aab8[0][0][2]/10 num[17]=aab8[0][0][2] mod 10 num[18]= aab8[0][day][2]/10 num[19]=aab8[0][day][2] mod 10 num[20]= aab8[0][0][3]/10 num[21]=aab8[0][0][3] mod 10 num[22]= aab8[0][day][3]/10 num[23]=aab8[0][day][3] mod 10 num[24]= aab8[0][0][4]/10 num[25]=aab8[0][0][4] mod 10 num[26]= aab8[0][day][4]/10 num[27]=aab8[0][day][4] mod 10 end if end sub sub procedure aylol() const aylol9 as byte[1][32][5]=(( (4,12,3,6,7), (14,11,50,39,54), (15,11,49,37,52), (16,11,48,36,51), (17,10,47,35,50), (18,10,47,34,49), (18,10,46,32,47), (19,9,45,31,46), (20,9,44,29,44), (21,9,43,28,43), (21,8,42,26,41), (23,8,42,25,40), (24,8,41,23,38), (25,7,40,22,37), (26,7,39,20,35), (26,7,38,19,34), (27,6,37,17,32), (28,6,36,16,31), (29,5,35,14,29), (30,5,34,13,28), (31,5,33,11,26), (31,4,32,9,24), (32,4,31,8,23), (33,4,30,6,21), (34,3,29,5,20), (35,3,28,3,18), (35,3,27,2,17), (36,2,26,0,15), (37,2,24,59,14), (38,1,25,57,12), (39,1,23,56,11))) if day>=1 then num[0]= aylol9[0][0][1]/10 num[1]=aylol9[0][0][1] mod 10 num[2]= aylol9[0][day][1]/10 num[3]=aylol9[0][day][1] mod 10 num[4]= aylol9[0][0][0]/10 num[5]=aylol9[0][0][0] mod 10 num[6]= aylol9[0][day][0]/10 num[7]=aylol9[0][day][0] mod 10 num[8]= month_/10 num[9]=month_ mod 10 num[10]= day/10 num[11]=day mod 10 num[12]=hr/10 num[13]=hr mod 10 num[14]= min/10 num[15]=min mod 10 num[16]= aylol9[0][0][2]/10 num[17]=aylol9[0][0][2] mod 10 num[18]= aylol9[0][day][2]/10 num[19]=aylol9[0][day][2] mod 10 num[20]= aylol9[0][0][3] div 10 num[21]=aylol9[0][0][3] mod 10 num[22]= aylol9[0][day][3]/10 num[23]=aylol9[0][day][3] mod 10 num[24]= aylol9[0][0][4] div 10 num[25]=aylol9[0][0][4] mod 10 num[26]= aylol9[0][day][4]/10 num[27]=aylol9[0][day][4] mod 10 end if end sub sub procedure teshren1() const teshren10 as byte[1][32][5]=(( (4,12,3,5,7), (39,1,22,55,10), (40,0,21,54,9), (41,0,20,52,7), (42,0,19,50,5), (42,59,18,49,4), (43,59,17,48,3), (44,59,16,46,1), (45,58,14,44,0), (45,58,13,43,59), (46,58,12,42,58), (47,58,11,40,57), (48,57,10,39,55), (48,57,9,38,54), (49,57,8,37,53), (50,57,7,35,52), (51,56,6,34,50), (52,56,5,33,49), (52,56,4,31,46), (53,56,3,29,44), (54,56,2,28,43), (55,55,1,26,41), (56,55,0,25,40), (56,55,59,24,39), (57,55,58,23,38), (58,55,58,22,37), (59,55,57,20,35), (0,55,56,19,34), (0,55,55,18,33), (1,54,54,17,32), (2,54,53,15,31), (3,54,52,14,29) )) if day>=1 then num[0]= teshren10[0][0][1]/10 num[1]=teshren10[0][0][1] mod 10 num[2]= teshren10[0][day][1]/10 num[3]=teshren10[0][day][1] mod 10 num[4]= teshren10[0][0][0]/10 num[5]=teshren10[0][0][0] mod 10 num[6]= teshren10[0][day][0]/10 num[7]=teshren10[0][day][0] mod 10 num[8]= month_/10 num[9]=month_ mod 10 num[10]= day/10 num[11]=day mod 10 num[12]=hr/10 num[13]=hr mod 10 num[14]= min/10 num[15]=min mod 10 num[16]= teshren10[0][0][2]/10 num[17]=teshren10[0][0][2] mod 10 num[18]= teshren10[0][day][2]/10 num[19]=teshren10[0][day][2] mod 10 num[20]= teshren10[0][0][3] div 10 num[21]=teshren10[0][0][3] mod 10 num[22]= teshren10[0][day][3]/10 num[23]=teshren10[0][day][3] mod 10 num[24]= teshren10[0][0][4] div 10 num[25]=teshren10[0][0][4] mod 10 num[26]= teshren10[0][day][4]/10 num[27]=teshren10[0][day][4] mod 10 end if end sub sub procedure teshren2() const teshren11 as byte[1][31][5]=(( (5,11,2,5,6), (4,54,52,13,28), (4,54,51,12,27), (5,54,50,11,26), (6,54,49,10,25), (7,54,49,9,24), (8,54,48,8,23), (9,55,47,8,23), (10,55,46,7,22), (10,55,46,7,22), (11,55,45,6,21), (12,55,45,5,20), (13,55,44,4,19), (14,55,43,3,18), (15,55,43,3,18), (16,56,42,2,17), (16,56,42,1,16), (17,56,41,1,16), (18,56,41,0,15), (19,56,41,59,14), (20,57,40,59,14), (21,57,40,58,13), (22,57,40,58,13), (22,58,39,57,12), (23,58,39,57,12), (24,58,39,57,12), (25,59,38,57,12), (26,59,38,57,12), (27,59,38,57,12), (27,0,38,56,11), (28,0,38,56,11)
)) if day>=1 then num[0]= teshren11[0][0][1]/10 num[1]=teshren11[0][0][1] mod 10 num[2]= teshren11[0][day][1]/10 num[3]=teshren11[0][day][1] mod 10 num[4]= teshren11[0][0][0]/10 num[5]=teshren11[0][0][0] mod 10 num[6]= teshren11[0][day][0]/10 num[7]=teshren11[0][day][0] mod 10 num[8]= month_/10 num[9]=month_ mod 10 num[10]= day/10 num[11]=day mod 10 num[12]=hr/10 num[13]=hr mod 10 num[14]= min/10 num[15]=min mod 10 num[16]= teshren11[0][0][2]/10 num[17]=teshren11[0][0][2] mod 10 num[18]= teshren11[0][day][2]/10 num[19]=teshren11[0][day][2] mod 10 num[20]= teshren11[0][0][3] div 10 num[21]=teshren11[0][0][3] mod 10 num[22]= teshren11[0][day][3]/10 num[23]=teshren11[0][day][3] mod 10 num[24]= teshren11[0][0][4] div 10 num[25]=teshren11[0][0][4] mod 10 num[26]= teshren11[0][day][4]/10 num[27]=teshren11[0][day][4] mod 10 end if end sub dim Soft_I2C_Scl as sbit at RC3_bit dim Soft_I2C_Sda as sbit at RC4_bit dim Soft_I2C_Scl_Direction as sbit at TRISC3_bit dim Soft_I2C_Sda_Direction as sbit at TRISC4_bit
sub procedure Read_Time(dim byref sec, min, hr, week_day, dday, mn, year as short)
Soft_I2C_Start() Soft_I2C_Write(0xD0) Soft_I2C_Write(0) Soft_I2C_Start() Soft_I2C_Write(0xD1) sec =Soft_I2C_Read(1) min =Soft_I2C_Read(1) hr =Soft_I2C_Read(1) week_day =Soft_I2C_Read(1) dday =Soft_I2C_Read(1) mn =Soft_I2C_Read(1) year =Soft_I2C_Read(0) Soft_I2C_Stop() end sub sub procedure Write_Time(dim address1 as short,dim data_wr as short) Soft_I2C_Start() Soft_I2C_Write(0xD0) Soft_I2C_Write(address1) Soft_I2C_Write(data_wr) Soft_I2C_Stop() end sub sub procedure display() 'PORTB = not PORTB ' Toggle PORTB LEDs porte.0=0 porte.1=1 for i=0 to 15 porta=i portb=not seg[num[i]] delay_ms(1) next i porte.0=1 porte.1=0 for i=16 to 27 porta=i portb=not seg[num[i]] delay_ms(1) next i end sub ' Declarations section dim counter as word
sub procedure Interrupt() Inc(counter) if counter =50 then Read_Time(sec,min,hr,week_day,dday,mn,year) min=bcd2dec(min) hr=bcd2dec(hr) day=bcd2dec(dday) month_=bcd2dec(mn) if hr>24 then hr=hr-24 end if counter = 0 end if ' Increment value of counter on every interrupt TMR0 = 0 INTCON = 0xA0 ' Set T0IE, clear T0IF end sub sub procedure setminute () if Button(PORTC, 1, 1, 1) then ' set minutes oldstate = 255 end if if oldstate and Button(PORTC, 1, 1, 0) then set1=min+1 if set1>59 then set1=0 end if set1=Dec2Bcd16(set1) Write_Time(1,set1) oldstate = 0 end if end sub sub procedure sethour() if Button(PORTC, 2, 1, 1) then ' set hours oldstate1 = 255 end if if oldstate1 and Button(PORTC, 2, 1, 0) then set1=hr+1 if set1>23 then set1=0 end if set1=Dec2Bcd16(set1) Write_Time(2,set1) oldstate1 = 0 end if end sub
sub procedure setmonth() if Button(PORTC, 6, 1, 1) then ' set months oldstate3 = 255 end if if oldstate3 and Button(PORTC, 6, 1, 0) then set1=month_+1 if set1>12 then set1=0 end if set1=Dec2Bcd16(set1) Write_Time(5,set1) oldstate3 = 0 end if end sub
sub procedure setday() if Button(PORTC, 5, 1, 1) then ' set day oldstate2 = 255 end if if oldstate2 and Button(PORTC, 5, 1, 0) then set1=day+1 select case month_ case 1 if set1>31 then set1=0 end if case 2 if set1>29 then set1=0 end if case 3 if set1>31 then set1=0 end if case 4 if set1>30 then set1=0 end if case 5 if set1>31 then set1=0 end if case 6 if set1>30 then set1=0 end if case 7 if set1>31 then set1=0 end if case 8 if set1>31 then set1=0 end if case 9 if set1>30 then set1=0 end if case 10 if set1>31 then set1=0 end if case 11 if set1>30 then set1=0 end if case 12 if set1>31 then set1=0 end if end select set1=Dec2Bcd16(set1) Write_Time(4,set1) oldstate2 = 0 end if end sub main: ADCON1 = 0x3F ' Set AN pins to Digital I/O ADCON0 = 0 option_reg = 0xC7 ' Set TMR0 in 8bit mode, assign prescaler to TMR0 TRISB = 0 ' PORTB is output TRISC = 0 PORTb = 0xFF ' Initialize PORTB TMR0 = 0 ' Timer0 initial value INTCON = 0xA0 ' Enable TMRO interrupt counter = 0 ' Initialize counter trisa=0 trisd=1 trisb=0 trise=0 PORTd=0 while true select case month_ case 1 kanon2() case 2 shbat() case 3 aathar() case 4 nesan() case 5 ayar() case 6 hazeran() case 7 tammoz() case 8 aab() case 9 aylol() case 10 teshren1() case 11 teshren2() case 12 kanon1() end select display() wend end. و شكرا للجميع | |
|