Islamic Prayer time module.
Kanagaraj
Member
Hi All,
I Want to write a program for Islamic prayer timings. I need to play the music automatically when the prayer time comes. There are 5 different times in a day and everyday the time will change.
Can anyone guide me on this?
Please share if anyone have module.
Thanks in advance.
I Want to write a program for Islamic prayer timings. I need to play the music automatically when the prayer time comes. There are 5 different times in a day and everyday the time will change.
Can anyone guide me on this?
Please share if anyone have module.
Thanks in advance.
Comments
-
There are any number of ways to accomplish this. but, the easiest would be to just watch the "time" the keyword "Time" is a little function that when called sends you back a text message in the format <HH:MM:SS> which is based on the master's clock.
{'05:00:00'}
So a very simple way is to just look for the strings you want.
This code snpet is just for the theory of it. You'll need to decide how you want to implement it in your code...DEFINE_VARIABLE volatile char Prayer_Times[][8]={ {'05:00:00'} // These are just initial values that can be changed dynamically ,{'10:00:00'} ,{'12:00:00'} ,{'15:00:00'} ,{'21:00:00'} } DEFINE_EVENT TIMLINE_EVENT[Prayer_Timer]{ // A timeline that triggers once very minute... sack_var char MyTIme[8] stack_var integer nloop; MyTime=TIME; for(nloop=length_array(Prayer_Times);nloop;nloop--){ if(MyTime==Prayer_Times[nloop]){ // it's prayer time X, where X=nloop, do something } }
this should get you started. You can use a variable to dynamically alter the prayer times if you with or just keep them at the exact same time. You'll have to setup the timeline, of course. And like I say, there are any number of ways to approach this. This is just a basic start to get you going.
-
Thanks for your reply. The main problem i am facing is to pull the 5 different times from the internet. Also its not the same time for everyday .
Please guide me on this.
Thanks. -
Yeah, I realized that the times are different. However, that is a whole other issue. My best advice is to see if you can find an RSS type feed that can provide it. Or, if you have access to some kind of document like an excel spread sheet that might have the times. You can then just parse for the data. I do not know of any such things. Sorry.
-
I wrote one in Duet awhile ago. Scraped the math out of some open source javascript. In the end we just subscribed to a service that provides the time based on location and wrote a simple Nelinx layer web client to handle the data.
-
I can help you on that, I have been working on this module for sometime and it is already done now, I have built a Netlinx module that will do the calculation based on your location and it will notify the Netlinx code through 7 channel events, one for each pray time plus sunrise and sunset
I'm afraid that I will not be able to share the code with you because I have done it for commercial use, if you wish I can share the module with you but you will need to buy a license for it to have it fully working
the module doesn't use any online services to calculate the times, everything is done locally in the Netlinx master
Please let me know if this works for you -
Have a look at this
http://praytimes.org/calculation/
http://praytimes.org/wiki/Code
If you are familiar with Julian dates I reckon you could write something in Netlinx.
There's a number of examples in other languages on the wiki page that you could adapt fairly easily too.
Simon
Categories
- All Categories
- 2.5K AMX General Discussion
- 922 AMX Technical Discussion
- 514 AMX Hardware
- 502 AMX Control Products
- 3 AMX Video Distribution Products
- 9 AMX Networked AV (SVSI) Products
- AMX Workspace & Collaboration Products
- 3.4K AMX Software
- 151 AMX Resource Management Suite Software
- 386 AMX Design Tools
- 2.4K NetLinx Studio
- 135 Duet/Cafe Duet
- 248 NetLinx Modules & Duet Modules
- 57 AMX RPM Forum
- 228 MODPEDIA - The Public Repository of Modules for Everyone
- 943 AMX Specialty Forums
- 2.6K AMXForums Archive
- 2.6K AMXForums Archive Threads
- 1.5K AMX Hardware
- 432 AMX Applications and Solutions
- 249 Residential Forum
- 182 Tips and Tricks
- 146 AMX Website/Forums
