|
| 1 | +#ifndef _GLOBALS_HPP_ |
| 2 | +#define _GLOBALS_HPP_ |
| 3 | + |
| 4 | +#include <Arduino.h> |
| 5 | +#include <WString.h> |
| 6 | + |
| 7 | +// Set to 1 if you are in the northern hemisphere. |
| 8 | +#define NORTHERN_HEMISPHERE 1 |
| 9 | + |
| 10 | +// Time in ms between LCD screen updates during slewing operations |
| 11 | +#define DISPLAY_UPDATE_TIME 200 |
| 12 | + |
| 13 | +// Stepper selection /////////// |
| 14 | +#define RA_Stepper_TYPE 0 // 28BYJ-48 = 0 | NEMA = 1 |
| 15 | +#define DEC_Stepper_TYPE 0 // 28BYJ-48 = 0 | NEMA = 1 |
| 16 | + |
| 17 | +// Are we supporting the Azimuth PA motor? |
| 18 | +#define AZIMUTH_MOTOR 1 |
| 19 | + |
| 20 | +// Make some variables in the sketch files available to the C++ code. |
| 21 | +extern bool inSerialControl; |
| 22 | +extern String version; |
| 23 | +extern byte PolarisRAHour; |
| 24 | +extern byte PolarisRAMinute; |
| 25 | +extern byte PolarisRASecond; |
| 26 | +extern float RAStepsPerRevolution; |
| 27 | +extern int RAPulleyTeeth; |
| 28 | +extern float RACircumference; |
| 29 | +extern float DECStepsPerRevolution; |
| 30 | +extern int DecPulleyTeeth; |
| 31 | + |
| 32 | +// Debugging output control |
| 33 | +// Debug log output is tricky, since if we simply send it out via Serial and a client is connected via Serial (USB), |
| 34 | +// the debug spew will interfere the protocol and confuse the client. To still be able to get access to debug logs in |
| 35 | +// this scenario, you can collect the debug logs in a memory ring buffer instead of sending them to Serial by |
| 36 | +// enabling the setting below |
| 37 | +// Use the Meade extension command :XGO# to retrieve the logs |
| 38 | +#define BUFFER_LOGS 0 |
| 39 | + |
| 40 | +// The level of debugging spew is controlled by setting DEBUG_LEVEL to a combination of the bit flags below. |
| 41 | +// Each bit in the debug level specifies a kind of debug to enable. |
| 42 | +#define DEBUG_NONE 0x00 |
| 43 | +#define DEBUG_INFO 0x01 |
| 44 | +#define DEBUG_SERIAL 0x02 |
| 45 | +#define DEBUG_WIFI 0x04 |
| 46 | +#define DEBUG_MOUNT 0x08 |
| 47 | +#define DEBUG_MOUNT_VERBOSE 0x10 |
| 48 | +#define DEBUG_GENERAL 0x20 |
| 49 | +#define DEBUG_MEADE 0x40 |
| 50 | +#define DEBUG_VERBOSE 0x80 |
| 51 | +#define DEBUG_ANY 0xFF |
| 52 | + |
| 53 | +// Bit Name Output |
| 54 | +// 0 DEBUG_INFO General output, like startup variables and status |
| 55 | +// 1 DEBUG_SERIAL Serial commands and replies |
| 56 | +// 2 DEBUG_WIFI Wifi related output |
| 57 | +// 3 DEBUG_MOUNT Mount processing output |
| 58 | +// 4 DEBUG_MOUNT_VERBOSE Verbose mount processing (coordinates, etc) |
| 59 | +// 5 DEBUG_GENERAL Other misc. output |
| 60 | +// 6 DEBUG_MEADE Meade command handling output |
| 61 | +// 7 DEBUG_VERBOSE other verbose debug output |
| 62 | +// 7 DEBUG_ANY all debug output |
| 63 | + |
| 64 | +// Set this to specify the amount of debug output OAT should generate. |
| 65 | +// #define DEBUG_LEVEL (DEBUG_SERIAL|DEBUG_WIFI|DEBUG_INFO|DEBUG_MOUNT|DEBUG_GENERAL) |
| 66 | +// #define DEBUG_LEVEL (DEBUG_ANY) |
| 67 | +// #define DEBUG_LEVEL (DEBUG_INFO|DEBUG_MOUNT|DEBUG_GENERAL) |
| 68 | +// #define DEBUG_LEVEL (DEBUG_WIFI|DEBUG_MEADE|DEBUG_INFO|DEBUG_GENERAL) |
| 69 | +// #define DEBUG_LEVEL (DEBUG_MEADE|DEBUG_INFO|DEBUG_GENERAL) |
| 70 | +#define DEBUG_LEVEL (DEBUG_NONE) |
| 71 | + |
| 72 | +// Set this to 1 to run a key diagnostic. No tracker functions are on at all. |
| 73 | +#define LCD_BUTTON_TEST 0 |
| 74 | + |
| 75 | +// Set to 1 to reverse the direction of RA motor |
| 76 | +#define INVERT_RA_DIR 0 |
| 77 | + |
| 78 | +// Set to 1 to reverse the direction of DEC motor |
| 79 | +#define INVERT_DEC_DIR 0 |
| 80 | + |
| 81 | +// If you do not have a LCD shield on your Arduino Uno, set this to 1 on the line below. This is |
| 82 | +// useful if you are always going to run the mount from a laptop anyway. |
| 83 | +#define HEADLESS_CLIENT 0 |
| 84 | + |
| 85 | +// This is set to 1 for boards that do not support interrupt timers |
| 86 | +#define RUN_STEPPERS_IN_MAIN_LOOP 0 |
| 87 | + |
| 88 | +#if defined(ESP8266) || defined(ESP32) |
| 89 | + #define ESPBOARD |
| 90 | + #undef HEADLESS_CLIENT |
| 91 | + #define HEADLESS_CLIENT 1 |
| 92 | + #define WIFI_ENABLED |
| 93 | + #define INFRA_SSID "YourSSID" |
| 94 | + #define INFRA_WPAKEY "YourWPAKey" |
| 95 | + #define OAT_WPAKEY "superSecret" |
| 96 | + #define HOSTNAME "OATerScope" |
| 97 | + // 0 - Infrastructure Only - Connecting to a Router |
| 98 | + // 1 - AP Mode Only - Acting as a Router |
| 99 | + // 2 - Attempt Infrastructure, Fail over to AP Mode. |
| 100 | + #define WIFI_MODE 2 |
| 101 | + #if defined(ESP8266) |
| 102 | + #undef RUN_STEPPERS_IN_MAIN_LOOP |
| 103 | + #define RUN_STEPPERS_IN_MAIN_LOOP 1 |
| 104 | + #endif |
| 105 | +#endif |
| 106 | + |
| 107 | + |
| 108 | +//////////////////////////////////////////////////////////////// |
| 109 | +// |
| 110 | +// FEATURE SUPPORT SECTION |
| 111 | +// |
| 112 | +// Since the Arduino Uno has very little memory (32KB code, 2KB data) all features |
| 113 | +// stretch the Uno a little too far. So in order to save memory we allow you to enable |
| 114 | +// and disable features to help manage memory usage. |
| 115 | +// If you run the tracker with an Arduino Mega, you can set all the features to 1. |
| 116 | +// |
| 117 | +// If you would like to drive your OAT mount with only the LCD Shield, or are on a Uno, |
| 118 | +// you should set SUPPORT_SERIAL_CONTROL to 0 |
| 119 | +// |
| 120 | +// If you feel comfortable with configuring the OAT at startup manually, you should set |
| 121 | +// SUPPORT_GUIDED_STARTUP to 0 (maybe after you've used it for a while you know what to do). |
| 122 | +// |
| 123 | +// The POI menu can take a little data memory and you may not need it. If not, you can set |
| 124 | +// SUPPORT_POINTS_OF_INTEREST to 0 |
| 125 | +// |
| 126 | +//////////////////////////////////////////////////////////////// |
| 127 | + |
| 128 | +// Set this to 1 this to enable the heating menu |
| 129 | +// NOTE: Heating is currently not supported! |
| 130 | +#define SUPPORT_HEATING 0 |
| 131 | + |
| 132 | +#if HEADLESS_CLIENT == 0 |
| 133 | + |
| 134 | + // Set this to 1 to support Guided Startup |
| 135 | + #define SUPPORT_GUIDED_STARTUP 1 |
| 136 | + |
| 137 | + // Set this to 1 to support full GO (was POI) menu. |
| 138 | + // If this is set to 0 you still have a GO menu that has Home and Park. |
| 139 | + #define SUPPORT_POINTS_OF_INTEREST 1 |
| 140 | + |
| 141 | + // Set this to 1 to support CTRL menu, allowing you to manually slew the mount with the buttons. |
| 142 | + #define SUPPORT_MANUAL_CONTROL 1 |
| 143 | + |
| 144 | + // Set this to 1 to support CAL menu, allowing you to calibrate various things |
| 145 | + #define SUPPORT_CALIBRATION 1 |
| 146 | + |
| 147 | + // Set this to 1 to support INFO menu that displays various pieces of information about the mount. |
| 148 | + #define SUPPORT_INFO_DISPLAY 1 |
| 149 | + |
| 150 | + // Set this to 1 to support Serial Meade LX200 protocol support |
| 151 | + #define SUPPORT_SERIAL_CONTROL 1 |
| 152 | + |
| 153 | +#else |
| 154 | + // If we are making a headleass (no screen, no keyboard) client, always enable Serial. |
| 155 | + #define SUPPORT_SERIAL_CONTROL 1 |
| 156 | +#endif // HEADLESS_CLIENT |
| 157 | + |
| 158 | +#endif // _GLOBALS_HPP |
0 commit comments