messages.h
 1  // SPDX-FileCopyrightText: 2018 Phillip Burgess for Adafruit Industries
 2  //
 3  // SPDX-License-Identifier: MIT
 4  
 5  // These are the messages that are randomly selected for a "spirit reading"
 6  // by touching Hallowing's capacitive touch pads.  Only letters A-Z and
 7  // numbers 0-9 are supported.  Space character introduces a brief pause
 8  // (this is why the example phrases all have a finishing space, so it holds
 9  // for a moment at the end of the reading).  Additionally, the "\x4\x5" at
10  // the end of some messages tells it to scroll to the left and right ends
11  // of "GOOD BYE" on the board.  Other points one can focus on:
12  // \x1 "YES"
13  // \x2 "NO"
14  // \x3 "GOOD BYE" center
15  // \x4 "GOOD BYE" left
16  // \x5 "GOOD BYE" right
17  // \x6 "SPIRIT BOARD" center
18  
19  const char *messages[] = {
20    "BOO ",
21    "HAPPY HALLOWEEN \x4\x5",
22    "TRICK OR TREAT ",
23    "SMELL MY FEET \x4\x5",
24    "STAY OFF THE MOORS \x4\x5",
25    "NEEDS MORE DRAGONS \x4\x5",
26    "BE AFRAID ",
27    "BE VERY AFRAID \x4\x5",
28    "SPOOPY ",
29    "HE DID THE MONSTER MASH \x4\x5",
30    "LET THE WILD RUMPUS START \x4\x5",
31    "TIS NOW THE WITCHING TIME \x4\x5",
32    "AWOOOO ",
33    "NEVERMORE \x4\x5",
34    "TRUST NO ONE \x4\x5",
35    "\x1  ", // "YES" and pause
36    "\x2  ", // "NO" and pause
37  };
38  
39  #define NUM_MESSAGES (sizeof messages / sizeof messages[0])
40  
41  // This table has the center(ish) coordinates for each letter and number on
42  // the spirit board graphic.  This was manually generated by eyeballing the
43  // center of each letter and reading the cursor coordinates in Photoshop.
44  
45  struct {
46    int16_t x;
47    int16_t y;
48  } coord[] = {
49    {  76, 253 }, // A      coord[] index  0
50    { 122, 223 }, // B
51    { 181, 199 }, // C
52    { 235, 184 }, // D
53    { 294, 172 }, // E
54    { 340, 168 }, // F
55    { 399, 166 }, // G
56    { 461, 168 }, // H
57    { 513, 175 }, // I
58    { 546, 185 }, // J
59    { 594, 195 }, // K
60    { 644, 214 }, // L
61    { 702, 241 }, // M
62    {  69, 345 }, // N
63    { 121, 312 }, // O
64    { 171, 288 }, // P
65    { 226, 269 }, // Q
66    { 283, 255 }, // R
67    { 332, 248 }, // S
68    { 382, 243 }, // T
69    { 441, 246 }, // U
70    { 500, 253 }, // V
71    { 566, 271 }, // W
72    { 629, 295 }, // X
73    { 679, 320 }, // Y
74    { 721, 348 }, // Z      coord[] index 25
75    { 612, 376 }, // 0                    26
76    { 175, 376 }, // 1
77    { 221, 376 }, // 2
78    { 270, 376 }, // 3
79    { 323, 376 }, // 4
80    { 370, 376 }, // 5
81    { 420, 376 }, // 6
82    { 467, 376 }, // 7
83    { 512, 376 }, // 8
84    { 561, 376 }, // 9                    35
85    { 222,  99 }, // YES                  36
86    { 567,  99 }, // NO
87    { 395, 471 }, // GOOD BYE center
88    { 315, 471 }, // GOOD BYE left
89    { 484, 471 }, // GOOD BYE right
90    { 395,  63 }  // SPIRIT BOARD center  41
91  };