(34S )- Sunrise/Sunset version II
|
02-11-2015, 09:42 PM
(This post was last modified: 06-15-2017 01:28 PM by Gene.)
Post: #1
|
|||
|
|||
(34S )- Sunrise/Sunset version II
The following WP34s program is a modified version of the one posted by Jeff O. a few days ago. It uses less memory registers and takes advantage of various 34s features, e.g. the date functions and inline integers. The output is different from Jeff's version, now all three results are displayed simultaneously.
The calculation is the same as in Jeff's version - I do not know much about all this, so I did not change the mathematics. Only some prestored constants (15, 18, 360, 24 etc.) were replaced with inline integers. Register use could be reduced significantly so that now R00 to R13 are all what's required. The number of registers might be reduced even further, but I did not want to change the calculation itself. I added a routine to automatically adjust the output for daylight savings time. It assumes the rules within the European Union, i.e. DST starts on last Sunday in March and ends on last Sunday in October. If a date falls within this period flag A is set and the "=" annunciator comes on. The mentioned rule is valid since 1996. The routine does not check for earlier dates and assumes the same rules for any year. If you do not want to include DST simply omit steps 4 to 6. You may even completely ignore time zones and use UTC by setting the timezone offset in R03 to 0. If you live outside the EU you may code your own DST routine. It just has to set flag A if the date falls within the DST period (and CF A otherwise). For more details please see Jeff's remarks on his program version. Registers 1 to 4 store some parameters you should personalize in the program code. Instead of the sample position (Frankfurt/Main, Germany) you should insert your local position (R01 and R02). Also the definition for sunrise/sunset (angle relative to zenith) can be adjusted (now 90°50'). Finally, here is the code: Code: LBL"SUN" Registers and flags: Code: Registers: Usage: Enter a date (in the current date format), and XEQ"SUN" returns the time of sunrise, sunset and the day length. The "=" annunciator signals that DST is assumed. The following example assumes d.my mode. If a different date mode is set, simply enter the date accordingly. Code: 11,022015 XEQ"SUN" I did not do any comprehensive tests, so the program may contain errors. As usual, any corrections, suggestions and comments are welcome. Dieter |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
(34S )- Sunrise/Sunset version II - Dieter - 02-11-2015 09:42 PM
RE: WP 34S - Sunrise/Sunset version II - Jeff O. - 02-13-2015, 12:14 AM
|
User(s) browsing this thread: 1 Guest(s)