Here is a BASIC program which will give the RA and DEC of the Sun to very high accuracy (a few seconds of arc) given year, date, and time (hours and minutes) as input. (Note, there are some extra variables printed in this version - helpful for debugging and generally checking what's happening). Note that the parallax of the Sun (which can be up to almost 10 arcseconds) is ignored. The RA, DEC are with respect to the center of the Earth. RA and DEC are in fractional hours and degrees - I'm not sure what your telescope wants.
10 DEFDBL A-H,J-Z
20 PI = 3.14159265#: TWOPI = 2# * PI: CONV = TWOPI / 360#
30 YEAR = 2000: MONTH = 8: DAY = 22: HOUR = 2: MIN = 0
get the time & date from the calculator instead
40 UTC = (TWOPI * (60# * HOUR + MIN)) / 1440#
50 DIM NDAY(12)
60 DATA 0,31,59,90,120,151,181,212,243,273,304,334
70 FOR I = 1 TO 12
80 READ NDAY(I)
90 NEXT I
100 YEARM = YEAR - 1900#
110 KDAY = INT((YEARM - 1#) / 4#)
120 JULDAY = 2415019.5# + YEARM*365# + KDAY
130 JULDAY = JULDAY + NDAY(MONTH) + DAY
140 IF(YEARM/4# - INT(YEARM/4#)) > .2 THEN GOTO 160
150 IF(MONTH > 2) THEN JULDAY = JULDAY + 1#
160 CENTURY = ( JULDAY - 2451545# ) / 36525#
170 STM = 24110.55# + CENTURY* (8640184.812866# + .093104#*CENTURY)
180 STM = STM/86400# - INT(STM/86400#)
190 STM = 2# * PI * STM: PRINT JULDAY,STM*12/PI
200 DAYS = JULDAY - 2451545# + (UTC/TWOPI)
210 SOLLON = 280.46# + .9856474# * DAYS
220 SOLLON = SOLLON - 360# * SGN(SOLLON)*INT(SOLLON/360#)
230 IF(SOLLON < 0) THEN SOLLON = SOLLON + 360#
240 SOLANOM = 357.528# + .9856003# * DAYS
250 SOLANOM = SOLANOM * CONV
260 SOLANOM = SOLANOM + TWOPI * SGN(SOLANOM)*INT(SOLANOM/TWOPI)
270 IF(SOLANOM < 0) THEN SOLANOM = SOLANOM + TWOPI
280 ECLLON = SOLLON + 1.915# * SIN(SOLANOM) + .02# * SIN(2#*SOLANOM)
290 ECLLON = ECLLON * CONV
300 ECLLON = ECLLON + TWOPI * SGN(ECLLON)*INT(ECLLON/TWOPI)
310 QUADRANT = ECLLON / (PI/2)
320 IQUAD = 1 + INT(QUADRANT)
325 PRINT ECLLON,QUADRANT,IQUAD
330 OBLIQ = 23.439# - .0000004# * DAYS
340 OBLIQ = OBLIQ * CONV
350 RA = ATN( COS(OBLIQ) * TAN(ECLLON) )
360 IF IQUAD=2 THEN RA = RA + PI
370 IF IQUAD=3 THEN RA = RA + PI
380 IF IQUAD=4 THEN RA = RA + TWOPI
390 ARG = SIN(OBLIQ) * SIN(ECLLON)
400 DEC = ATN(ARG/SQR(1-ARG*ARG)): PRINT RA*12/PI,DEC/CONV
I wrote this as part of the SUNMOON program which was published with my article on calibrating antennas by observing the Sun or Moon in the ARRL UHF/VHF Handbook. It uses a formula from the "American Ephemeris and Nautical Almanac" (published by the US Navy).
If you have questions, you can e-mail me directly.
Dave W8MIF