summaryrefslogtreecommitdiff
path: root/Puzzle_Box/Puzzle_Box.h
blob: bd5b2fb052f0ee916b6c0bd5ccb90714a558a659 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53



/* Pin assignments for the version 1.1 shield */
static const int GPSrx = 4, GPStx = 3; // GPS
static const int LCD_Enable = 6, LCD_RS = 5, LCD_RW = 7; // LCD
static const int LCD_DB4 = 16, LCD_DB5 = 17, LCD_DB6 = 18, LCD_DB7 = 19;
static const int pololu_switch_off = 12; // Pololu switch control
static const int servo_control = 9; // Servo control
static const int LED_pin = 2; // The button LED
static const int BUTTON_PIN = 1; // The pin for the button.

/* Function definitions */
void Msg(LiquidCrystal &lcd, const char *top, const char *bottom, unsigned long del);
void drawEye(int location);
void stepEyeAnimation();
void toggleEye(bool on);
void doMainStage();
void doButtonStage();
bool doUpdateDistance();
void doCheckOverrideSerial();
void doCheckAccess();
void PowerOff();
float toRandomUnit(int choice, float dist);
void showQuote(int quote);

/* Fixed values should not need changing */
static const int DEF_ATTEMPT_MAX = 50;
static const int EEPROM_OFFSET = 100;

/* Program Stage Constants */
static const int MAIN_STAGE = 1;
static const int BUTTON_STAGE = 2;

/* Random Units */
static const int NUMBER_OF_UNITS = 4;

/* Eye Animation Steps (12 step program) */
static const int eyeAnimationSteps[] = { 0, -1, -2, -2, -2, -1, 0, 1, 2, 2, 2, 1, 0 };
static const int MAX_EYE_STEPS = 13;


/* OLD CONSTANTS */

/* These values should be adjusted according to your needs */
static const int CLOSED_ANGLE = 80; // degrees
static const int OPEN_ANGLE = 200; // degrees

static const float DEST_LATITUDE = 47.272697;
static const float DEST_LONGITUDE = -122.021201;
static const int RADIUS = 100; // meters