Skip to content

Commit bea2576

Browse files
author
openastrotech
committed
arduino 1.2.5
1 parent 4642d88 commit bea2576

File tree

9 files changed

+41
-27
lines changed

9 files changed

+41
-27
lines changed

Software/Arduino code/OpenAstroTracker_v1.2.4/OpenAstroTracker_v1.2.4.ino renamed to Software/Arduino code/OpenAstroTracker/OpenAstroTracker.ino

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,16 @@
1010
1111
=======================================================================================================================================
1212
*/
13+
boolean north = true; // change this to 'false' if youre in the southern hemisphere
1314

1415
float speed = 1.000; // Use this value to slightly increase or decrese tracking speed. The values from the "CAL" menu will be added to this.
1516

16-
float RAsteps = 330; // 335.1417 // adjust this value to calibrate RA movement
17+
int RAsteps = 320; // adjust this value to calibrate RA movement
1718

1819
float RevSteps = 4096;
1920
// This is how many steps your 28BYJ-48 stepper needs for a full rotation. It is almost always 4096.
2021
// This code drives the steppers in halfstep mode
2122

22-
// ======================================================================================================================================
23-
2423
int RAspeed = 200; // You can change the speed and acceleration of the steppers here. Max. Speed = 600. High speeds tend to make
2524
int RAacceleration = 1000; // these cheap steppers unprecice
2625
int DECspeed = 200;

Software/Arduino code/OpenAstroTracker_v1.2.4/a_inits.ino renamed to Software/Arduino code/OpenAstroTracker/a_inits.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <LiquidCrystal.h>
66
#define HALFSTEP 8
77
#define FULLSTEP 4
8+
89
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
910

1011
#define motorPin1 2 // IN1 auf ULN2003 driver 1
@@ -86,6 +87,7 @@ int minDEC;
8687
int secDEC;
8788
float moveDEC;
8889
int DECselect;
90+
int printdegDEC;
8991

9092
//Hour correction
9193
int hourHA = 0;

Software/Arduino code/OpenAstroTracker_v1.2.4/c_buttons.ino renamed to Software/Arduino code/OpenAstroTracker/c_buttons.ino

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ void loop() {
55
//speedcalibration += inputcal / 1000;
66
float trackingspeed = ((((335.1417 / 24) / 12) * RevSteps) / 3590) - 1 + float(speedcalibration);
77

8-
float onehour = RevSteps * ((RAsteps) / 288);
8+
float onehour = float(float(RAsteps / 24) / 12) * RevSteps;
99
moveRA = (hourRA * onehour + minRA * (onehour / float(60)) + secRA * (onehour / float(3600))) / 2;
1010
moveDEC = (degreeDEC * float(164) + minDEC * (float(164) / float(60)) + secDEC * (float(164) / float(3600))) / 2;
1111

1212
if (moveRA > (6 * onehour / 2)) { //turn both RA and DEC axis around if target is below horizontal parallel
1313
moveRA -= long(12 * onehour / 2);
1414
moveDEC = -moveDEC;
1515
}
16-
if (moveRA < (-6 * onehour / 2)) {
16+
if (moveRA < (-6 * onehour / 2)) {
1717
moveRA += long(12 * onehour / 2);
1818
moveDEC = -moveDEC;
1919
}
@@ -163,6 +163,9 @@ void loop() {
163163
case btnRIGHT: {
164164
menu += 1;
165165
while (menu > 5) menu = 0;
166+
if (!north && menu == 3) menu = 4;
166167
break;
168+
169+
167170
}
168171
}

Software/Arduino code/OpenAstroTracker_v1.2.4/d_calculations.ino renamed to Software/Arduino code/OpenAstroTracker/d_calculations.ino

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ while (tracking == 1) {
2424
break;
2525
}
2626

27-
//if (stepperRA.distanceToGo() == 0) stepperRA.disableOutputs();
2827

2928
currentSecs = millis() / 1000;
3029

@@ -56,6 +55,11 @@ if (hourRA > 23) hourRA -= 24;
5655
if (hourRAprint < 0) hourRAprint += 24;
5756
if (minRAprint < 0) minRAprint += 60;
5857

59-
60-
int printdegDEC = degreeDEC + 90;
61-
if (printdegDEC > 90) degreeDEC = 0;
58+
if (!north) {
59+
printdegDEC = degreeDEC - 90;
60+
if (printdegDEC < -90) degreeDEC = 0;
61+
}
62+
else {
63+
printdegDEC = degreeDEC + 90;
64+
if (printdegDEC > 90) degreeDEC = 0;
65+
}

Software/Arduino code/OpenAstroTracker_v1.2.4/e_printout.ino renamed to Software/Arduino code/OpenAstroTracker/e_printout.ino

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
if (!pcControl) {
2-
3-
42
lcd.setCursor(0, 0);
5-
6-
if (menu == 0) lcd.print(">RAs<DEC HA POL ");
7-
if (menu == 1) lcd.print(" RAs>DEC<HA POL ");
8-
//if (menu == 2) lcd.print(" RAs DEC>HOM<TRK");
9-
//if (menu == 3) lcd.print(" RAs DEC HOM>TRK");
10-
if (menu == 2) lcd.print(" RAs DEC>HA<POL ");
11-
if (menu == 3) lcd.print(" RAs DEC HA>POL<");
12-
if (menu == 4) lcd.print(" DEC HA POL>HEAT");
13-
if (menu == 5) lcd.print("HA POL HEAT>CAL<");
3+
4+
if (north == true) {
5+
if (menu == 0) lcd.print(">RAs<DEC HA POL ");
6+
if (menu == 1) lcd.print(" RAs>DEC<HA POL ");
7+
if (menu == 2) lcd.print(" RAs DEC>HA<POL ");
8+
if (menu == 3) lcd.print(" RAs DEC HA>POL<");
9+
if (menu == 4) lcd.print(" DEC HA POL>HEAT");
10+
if (menu == 5) lcd.print("HA POL HEAT>CAL<");
11+
}
12+
else {
13+
if (menu == 0) lcd.print(">RAs<DEC HA HEAT");
14+
if (menu == 1) lcd.print(" RAs>DEC<HA HEAT");
15+
if (menu == 2) lcd.print(" RAs DEC>HA<HEAT");
16+
//if (menu == 3) lcd.print(" RAs DEC HA>POL<");
17+
if (menu == 4) lcd.print(" DEC HA>HEAT<CAL");
18+
if (menu == 5) lcd.print("DEC HA HEAT>CAL<");
19+
}
1420

1521

1622

@@ -30,11 +36,11 @@ if (!pcControl) {
3036
lcd.print("m ");
3137
lcd.print(int(secRAprint));
3238
lcd.print("s");
33-
//lcd.print(" ");
39+
lcd.print(" ");
3440

3541
//lcd.print(int(diamCorrection)); //for debugging
36-
lcd.print("");
37-
lcd.print(moveRA);
42+
//lcd.print("");
43+
//lcd.print(moveRA);
3844
//lcd.print(" ");
3945
}
4046
if (RAselect == 1) {
@@ -191,11 +197,11 @@ if (!pcControl) {
191197
}
192198
if (hPolarisPosition < -6) hPolarisPosition += 24;
193199
if (hPolarisPosition > 6) hPolarisPosition -= 12;
194-
if (menu == 3) {
195-
lcd.print(hPolarisPosition);
200+
if (menu == 3 && north == true) {
201+
/*lcd.print(hPolarisPosition);
196202
lcd.print(" ");
197-
lcd.print(mPolarisPosition);
198-
//lcd.print("Sel for Polaris");
203+
lcd.print(mPolarisPosition);*/
204+
lcd.print("Sel for Polaris");
199205
lcd.print(" ");
200206
/*lcd.print(int(hourRAprint)); //debugging
201207
lcd.print(" ");

0 commit comments

Comments
 (0)