-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGamer.cpp
More file actions
732 lines (665 loc) · 20.9 KB
/
Copy pathGamer.cpp
File metadata and controls
732 lines (665 loc) · 20.9 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
// Gamer — hardware-abstraction library for the TWSU DIY Gamer Kit.
// Derived from the Technology Will Save Us (TWSU) Gamer library.
// Modifications © 2026 28pins — https://github.com/28pins/TWSUGamerPlus
// SPDX-License-Identifier: MIT
#include "Gamer.h"
#include "Arduino.h"
// Font-table sentinel — end of character bitmap column list
#define LETEND B10101010
static bool toggleVal = false;
static int split = 0;
static bool ir = false;
static bool irTog = false;
static bool toneIsPlaying = false;
static bool playTog = false;
static bool toneStopped = false;
// Number of brightness levels added to the display when the onboard LED is on,
// compensating for the voltage-drop dim caused by the LED's current draw.
static constexpr uint8_t LED_BRIGHTNESS_BOOST = 3;
static Gamer *thisGamer = NULL;
// Interrupt service routine.
ISR(TIMER2_COMPB_vect)
{
if(ir == 1) {
thisGamer->isrRoutine();
}
}
// Interrupt service routine for simultaneous IR & buzzer.
ISR(TIMER2_COMPA_vect)
{
if(ir == 0) {
if(toneIsPlaying) {
if (toggleVal) {
PORTD |= _BV(PORTD2);
toggleVal = 0;
if(split % 10 == 0 ){
thisGamer->isrRoutine();
}
}
else {
PORTD &= ~_BV(PORTD2);
toggleVal = 1;
if(split % 10== 0 ) {
thisGamer->isrRoutine();
}
}
}
else {
PORTD &= ~_BV(PORTD2);
if(split % 10 == 0 ) {
thisGamer->isrRoutine();
}
}
split++;
}
}
/**
Constructor. Also initiates software serial for IR
communiation.
*/
//#ifdef MULTIPLAYER
//Gamer::Gamer() : _serial(5,4) {
//}
//#else
Gamer::Gamer() {
}
//#endif
/**
Plays a tone on the buzzer.
@param note the desired frequency
*/
void Gamer::playTone(int note)
{
TIMSK2 &= (1<<OCIE2A);
if(playTog == false){
toneStopped = false;
irTog = true;
ir = 0;
noInterrupts();
TCCR2A = ~(_BV(COM2B1)) | ~(_BV(WGM21)) | ~(_BV(WGM20));
TCCR2B = ~(_BV(WGM22)) | ~(_BV(CS22));
TCCR2B = (TCCR2B & 0b0000000) | 0;
TIMSK2 = ~(_BV(OCIE2B));
OCR2A = 0;
TIMSK2 = 0;
OCR2B = 0;
TCCR2A = 0;
TCCR2B = 0;
TCNT2 = 0;
TCCR2A |= (1 << WGM21);
OCR2A = 180;
TCCR2B |= (1 << CS21);
TIMSK2 |= (1 << OCIE2A);
playTog = true;
}
toneIsPlaying = true;
OCR2A = note;
interrupts();
}
/**
Stops any frequency on the buzzer pin.
*/
void Gamer::stopTone()
{
if(toneStopped == false){
TIMSK2 &= ~(1<<OCIE2A);
toneStopped = true;
toneIsPlaying = false;
playTog = false;
OCR2A = 180;
digitalWrite(2,LOW);
split = 0;
toggleVal = 0;
irTog = false;
irBegin();
}
OCR1A = 14;
toneIsPlaying = false;
}
/**
Stops the 38KHz wave for the IR transmitter.
*/
void Gamer::irEnd()
{
irTog = false;
}
/**
Creates a 38KHz wave for the IR transmitter.
*/
void Gamer::irBegin()
{
TIMSK2 &= ~(1<<OCIE2A);
TIMSK2 &= (1<<OCIE1B);
if(irTog == false) {
irTog = true;
noInterrupts();
TCCR2A |= ~(_BV(WGM21));
TCCR2B |= ~(_BV(CS21));
TIMSK2 |= ~(_BV(OCIE2A));
TCCR2A = 0;
TCCR2B = 0;
TCNT2 = 0;
TCCR2A = _BV(COM2B1) | _BV(WGM21) | _BV(WGM20);
TCCR2B = _BV(WGM22) | _BV(CS22);
OCR2A = 51;
OCR2B = 26;
TCCR2B = (TCCR2B & 0b00111000) | 0x2;
TIMSK2 = _BV(OCIE2B);
interrupts();
ir = 1;
}
}
/**
Initialises the library, starts timers, and sets pins.
*/
void Gamer::begin()
{
::thisGamer = this;
_refreshRate = 50;
_brightness = 8;
_baseBrightness = 8;
_ledCompensation = true;
ldrThreshold = 300;
// Setup outputs
pinMode(3, OUTPUT);
for(int i=6; i<=10; i++) pinMode(i, OUTPUT);
pinMode(2, OUTPUT);
pinMode(13, OUTPUT);
pinMode(5,INPUT);
// Setup inputs
DDRC = B00000;
PORTC = B11111;
//Analog Read 16 divisor
ADCSRA &= ~(1 << ADPS2);
irBegin();
}
// Inputs --------------------------------
/**
Checks if a button has been pressed (unique press)
@param input the button to check
@return The state of the button
*/
bool Gamer::isPressed(uint8_t input)
{
if(buttonFlags[input]) {
buttonFlags[input] = 0;
return true;
}
else return false;
}
/**
Checks if the button is currently held down.
@param input the button to check
@return the state of the button
*/
bool Gamer::isHeld(uint8_t input)
{
bool result = (PINC & (1<<input)) >> input;
return !result;
}
/**
Returns the current value of the LDR
@return LDR value between 0 and 1023
*/
int Gamer::ldrValue()
{
return analogRead(LDR);
}
/**
Changes the "pressed" event threshold for the LDR.
@param threshold the difference in light that triggers the event
*/
void Gamer::setldrThreshold(uint16_t threshold)
{
ldrThreshold = threshold;
}
/**
Gamer v1.9 capacitive touch instead of LDR
*/
bool Gamer::capTouch()
{
pinMode(CAP_TOUCH_PIN, OUTPUT);
digitalWrite(CAP_TOUCH_PIN, LOW);
delay(1);
// Prevent the timer IRQ from disturbing our measurement
noInterrupts();
// Make the pin an input with the internal pull-up on
pinMode(CAP_TOUCH_PIN, INPUT_PULLUP);
// Now see how long the pin to get pulled up. This manual unrolling of the loop
// decreases the number of hardware cycles between each read of the pin,
// thus increasing sensitivity.
uint8_t cycles = 17;
if (digitalRead(CAP_TOUCH_PIN)) { cycles = 0;}
else if (digitalRead(CAP_TOUCH_PIN)) { cycles = 1;}
else if (digitalRead(CAP_TOUCH_PIN)) { cycles = 2;}
else if (digitalRead(CAP_TOUCH_PIN)) { cycles = 3;}
else if (digitalRead(CAP_TOUCH_PIN)) { cycles = 4;}
else if (digitalRead(CAP_TOUCH_PIN)) { cycles = 5;}
else if (digitalRead(CAP_TOUCH_PIN)) { cycles = 6;}
else if (digitalRead(CAP_TOUCH_PIN)) { cycles = 7;}
else if (digitalRead(CAP_TOUCH_PIN)) { cycles = 8;}
else if (digitalRead(CAP_TOUCH_PIN)) { cycles = 9;}
else if (digitalRead(CAP_TOUCH_PIN)) { cycles = 10;}
else if (digitalRead(CAP_TOUCH_PIN)) { cycles = 11;}
else if (digitalRead(CAP_TOUCH_PIN)) { cycles = 12;}
else if (digitalRead(CAP_TOUCH_PIN)) { cycles = 13;}
else if (digitalRead(CAP_TOUCH_PIN)) { cycles = 14;}
else if (digitalRead(CAP_TOUCH_PIN)) { cycles = 15;}
else if (digitalRead(CAP_TOUCH_PIN)) { cycles = 16;}
// End of timing-critical section
interrupts();
// Discharge the pin again by setting it low and output
// It's important to leave the pins low if you want to
// be able to touch more than 1 sensor at a time - if
// the sensor is left pulled high, when you touch
// two sensors, your body will transfer the charge between
// sensors.
digitalWrite(CAP_TOUCH_PIN, LOW);
pinMode(CAP_TOUCH_PIN, OUTPUT);
return (cycles > 0);
}
// Outputs -------------------------------
/**
Sets the display's refresh rate. 1 = 1 row per timer cycle. 10 = 1 row every 10 timer cycles.
@param refreshRate the display's refresh rate modulo against the timer.
*/
void Gamer::setRefreshRate(uint16_t refreshRate)
{
_refreshRate = refreshRate;
}
/**
Recalculates the effective ISR brightness from the base level and the current LED state.
Call after any change to _baseBrightness, _ledCompensation, or the LED pin.
*/
void Gamer::updateEffectiveBrightness()
{
if (digitalRead(PIN_LED) && _ledCompensation) {
uint8_t boosted = _baseBrightness + LED_BRIGHTNESS_BOOST;
_brightness = (boosted > 8) ? 8 : boosted;
} else {
_brightness = _baseBrightness;
}
}
/**
Sets the display brightness.
@param level brightness from 1 (dimmest) to 8 (full). Values outside this range are clamped.
*/
void Gamer::setBrightness(uint8_t level)
{
if (level < 1) level = 1;
if (level > 8) level = 8;
_baseBrightness = level;
updateEffectiveBrightness();
}
/**
Returns the user-set brightness level (1–8), excluding any active LED compensation boost.
*/
uint8_t Gamer::getBrightness() const
{
return _baseBrightness;
}
/**
Enables or disables the automatic brightness boost applied when the onboard LED is on.
When enabled (default), setLED(true) raises the effective brightness by LED_BRIGHTNESS_BOOST
to compensate for the voltage-drop dim caused by the LED's current draw.
@param enabled true to enable compensation, false to disable
*/
void Gamer::setLEDCompensation(bool enabled)
{
_ledCompensation = enabled;
updateEffectiveBrightness();
}
/**
Returns whether LED brightness compensation is currently enabled.
*/
bool Gamer::getLEDCompensation() const
{
return _ledCompensation;
}
/**
Burns the display[][] array onto the display. Call this when you're done changing pixels in your game.
*/
void Gamer::updateDisplay()
{
byte newImage[8];
for(byte j=0; j<8; j++) {
newImage[j] = 0x00;
for(byte i=0; i<8; i++) {
newImage[j] <<= 1;
newImage[j] |= display[i][j];
}
}
// Only copy if changed (optimize unnecessary writes)
bool changed = false;
for(byte i=0; i<8; i++) {
if (newImage[i] != image[i]) {
changed = true;
break;
}
}
if(changed) {
for(byte i=0; i<8; i++) image[i] = newImage[i];
}
}
/**
Turns on all the pixels on the display.
*/
void Gamer::allOn()
{
for(byte j=0; j<8; j++) {
for(byte i=0; i<8; i++) display[i][j] = 1;
}
updateDisplay();
}
/**
Clears all pixels off the display.
*/
void Gamer::clear()
{
for(byte j=0; j<8; j++) {
for(byte i=0; i<8; i++) display[i][j] = 0;
}
updateDisplay();
}
/**
Prints an 8 byte array onto the display.
@param img the 8 byte array to display
*/
void Gamer::printImage(byte* img)
{
for(byte j=0; j<8; j++) {
for(byte i=0; i<8; i++) {
display[i][j] = (img[j] & (1 << (7-i))) != 0;
}
}
updateDisplay();
}
/**
Prints an 8 byte array onto the display at an X/Y position.
@param img the 8 byte array to display
@param x the image's x position
@param y the image's y position
*/
void Gamer::printImage(byte* img, int x, int y)
{
for(byte j=0; j<8; j++) {
for(byte i=0; i<8; i++) {
if(i+x >= 0 && i+x < 8 && j+y >= 0 && j+y < 8) {
display[i+x][j+y] = (img[j] & (1 << (7-i))) != 0;
}
}
}
updateDisplay();
}
/**
Sets the value of the red LED.
When LED compensation is enabled (default), turning the LED on boosts the effective
display brightness by LED_BRIGHTNESS_BOOST to offset the voltage-drop dim caused by
the LED's current draw. Compensation can be toggled with setLEDCompensation().
@param value the LED's boolean value
*/
void Gamer::setLED(bool value)
{
digitalWrite(PIN_LED, value);
updateEffectiveBrightness();
}
/**
Toggles the value of the red LED (also applies/removes brightness compensation).
*/
void Gamer::toggleLED()
{
setLED(!digitalRead(PIN_LED));
}
/**
Displays the next row on the display to achieve row scanning.
*/
void Gamer::updateRow()
{
if(counter==8) {
counter = 0;
currentRow = 0x80;
}
writeToRegister(0);
writeToDriver(image[counter]);
writeToRegister(currentRow);
currentRow >>= 1;
counter++;
}
/**
Writes a byte to the TLC5916 LED driver (cathodes).
@param dataOut the byte to write to the driver
*/
void Gamer::writeToDriver(byte dataOut)
{
// Output enable HIGH
PORTB |= _BV(PORTB2);
// Send byte to driver
for(byte x=0; x<8; x++) {
PORTD &= ~_BV(PORTD6);
if(((dataOut & (1<<x)) >> x)) PORTB |= _BV(PORTB0);
else PORTB &= ~_BV(PORTB0);
PORTD |= _BV(PORTD6);
}
PORTD &= ~_BV(PORTD6);
PORTB |= _BV(PORTB1);
PORTB &= ~_BV(PORTB1);
PORTB &= ~_BV(PORTB2);
}
/**
Writes a byte to the MIC5891 shift register (anodes).
@param dataOut the byte to write to the register
*/
void Gamer::writeToRegister(byte dataOut)
{
for(byte y=0; y<8; y++) {
if((dataOut & (1<<y)) >> y) PORTB |= _BV(PORTB0);
else PORTB &= ~_BV(PORTB0);
PORTD |= _BV(PORTD7);
PORTD &= ~_BV(PORTD7);
}
PORTB |= _BV(PORTB1);
PORTB &= ~_BV(PORTB1);
}
/**
Checks if inputs have changed to track button and LDR events.
*/
void Gamer::checkInputs()
{
for(int i=0; i<6; i++) {
if(i != 5) {
currentInputState[i] = (PINC & (1<<i)) >> i;
if(currentInputState[i] != lastInputState[i]) {
if(currentInputState[i] == 0) {
buttonFlags[i] = 1;
}
}
lastInputState[i] = currentInputState[i];
}
else {
currentInputState[i] = analogRead(LDR);
if(currentInputState[i] - lastInputState[i] >= (int)ldrThreshold) buttonFlags[i] = 1;
lastInputState[i] = currentInputState[i];
}
}
}
/**
Runs routines within the Interrupt Service Routine.
Display updating, button event tracking, LDR updating.
*/
void Gamer::isrRoutine()
{
if(ir == 1){
pulseCount++;
if(pulseCount >= _refreshRate) {
updateRow();
pulseCount = 0;
} else if (_brightness < 8 && pulseCount == (byte)(((uint16_t)_brightness * _refreshRate) / 8)) {
// Blank after (_brightness/8) of the row period for software-PWM dimming (8 levels total).
// The next updateRow() call will re-enable outputs for the following row.
PORTB |= _BV(PORTB2);
}
if(pulseCount == _refreshRate/2) {
checkInputs();
}
}
if (ir == 0){
updateRow();
checkInputs();
}
}
/**
Scrolls a string across the display.
@param string the string that will be scrolled
*/
void Gamer::printString(const char* string)
{
byte screen[8]={0};
clear();
for( int index = 0; string[index] != '\0'; index++ ){
char c = string[index];
int letIx = 0;
if( c>='A' && c<='Z' ) letIx = c-'A'+1;
else if( c>='a' && c<='z' ) letIx = c-'a'+1+26;
else if( c>='!' && c<='/' ) letIx = c+20;
else if( c>=':' && c<='@' ) letIx = c+10;
else if( c>='0' && c<='9' ) letIx = c+27;
int colIx = 0;
byte col;
while( (col = pgm_read_byte(&allLetters[letIx][colIx])) != LETEND ){
appendColumn(screen, col);
colIx++;
}
}
for( int i=0; i<8; i++)
appendColumn(screen, 0);
}
/**
Appends the column for scrolling the string across the display.
@param screen the current screen to append.
@param col the column to add
*/
void Gamer::appendColumn(byte* screen, byte col)
{
for( byte i=0; i<8; i++){
screen[i]<<=1;
if( (col&(1<<(7-i)))!=0 ) screen[i]++;
}
printImage(screen);
delay(60);
}
// Removed showScore() — games use the version in the main .ino file instead.
/**
Prints an 8-byte PROGMEM image onto the display.
@param pgm_img pointer to 8 bytes stored in PROGMEM
*/
void Gamer::printImagePGM(const byte* pgm_img)
{
byte buf[8];
for (byte i = 0; i < 8; i++) buf[i] = pgm_read_byte(pgm_img + i);
printImage(buf);
}
/**
All the letters in the world.
*/
const uint8_t Gamer::allLetters[85][9] PROGMEM = {
{B00000000,B00000000,B00000000,LETEND}, // space
{B01111110,B10010000,B10010000,B10010000,B01111110,B00000000,LETEND}, // A
{B11111110,B10010010,B10010010,B10010010,B01101100,B00000000,LETEND}, // B
{B01111100,B10000010,B10000010,B10000010,B01000100,B00000000,LETEND}, // C
{B11111110,B10000010,B10000010,B01000100,B00111000,B00000000,LETEND}, // D
{B11111110,B10010010,B10010010,B10010010,B10000010,B00000000,LETEND}, // E
{B11111110,B10010000,B10010000,B10010000,B10000000,B00000000,LETEND}, // F
{B01111100,B10000010,B10001010,B10001100,B01001110,B00000000,LETEND}, // G
{B11111110,B00010000,B00010000,B00010000,B11111110,B00000000,LETEND}, // H
{B10000010,B11111110,B10000010,B00000000,LETEND}, // I
{B00000100,B00000010,B10000010,B11111100,B10000000,B00000000,LETEND}, // J
{B11111110,B00010000,B00101000,B01000100,B10000010,B00000000,LETEND}, // K
{B11111110,B00000010,B00000010,B00000010,B00000010,B00000000,LETEND}, // L
{B11111110,B01000000,B00100000,B01000000,B11111110,B00000000,LETEND}, // M
{B11111110,B01100000,B00010000,B00001100,B11111110,B00000000,LETEND}, // N
{B01111100,B10000010,B10000010,B10000010,B01111100,B00000000,LETEND}, // O
{B11111110,B10010000,B10010000,B10010000,B01100000,B00000000,LETEND}, // P
{B01111100,B10000010,B10000010,B10000100,B01111010,B00000000,LETEND}, // Q
{B11111110,B10010000,B10011000,B10010100,B01100010,B00000000,LETEND}, // R
{B01100100,B10010010,B10010010,B10010010,B01001100,B00000000,LETEND}, // S
{B10000000,B10000000,B11111110,B10000000,B10000000,B00000000,LETEND}, // T
{B11111100,B00000010,B00000010,B00000010,B11111100,B00000000,LETEND}, // U
{B11100000,B00011000,B00000110,B00011000,B11100000,B00000000,LETEND}, // V
{B11111100,B00000010,B00011100,B00000010,B11111100,B00000000,LETEND}, // W
{B10000010,B01101100,B00010000,B01101100,B10000010,B00000000,LETEND}, // X
{B11000000,B00100000,B00011110,B00100000,B11000000,B00000000,LETEND}, // Y
{B10000110,B10001010,B10010010,B10100010,B11000010,B00000000,LETEND}, // Z
{B00011100,B00100010,B00100010,B00011110,B00000000,LETEND}, // a
{B01111110,B00010010,B00010010,B00001100,B00000000,LETEND}, // b
{B00011100,B00100010,B00100010,B00010010,B00000000,LETEND}, // c
{B00001100,B00010010,B00010010,B11111110,B00000000,LETEND}, // d
{B00011100,B00101010,B00101010,B00011010,B00000000,LETEND}, // e
{B00111110,B01001000,B01000000,B00000000,LETEND}, // f
{B00001101,B00010101,B00011110,B00000000,LETEND}, // g
{B01111110,B00010000,B00001110,B00000000,LETEND}, // h
{B01011110,B00000000,LETEND}, // i
{B00000010,B00000010,B01011100,B00000000,LETEND}, // j
{B11111110,B00011000,B00100110,B00000000,LETEND}, // k
{B01111100,B00000010,B00000010,B00000000,LETEND}, // l
{B00011110,B00100000,B00011000,B00100000,B00011110,B00000000,LETEND}, // m
{B00111110,B00010000,B00100000,B00011110,B00000000,LETEND}, // n
{B00011100,B00100010,B00100010,B00011100,B00000000,LETEND}, // o
{B00111111,B00100100,B00100100,B00011000,B00000000,LETEND}, // p
{B00011000,B00100100,B00100100,B00111111,B00000000,LETEND}, // q
{B00111110,B00010000,B00100000,B00100000,B00000000,LETEND}, // r
{B00010010,B00101010,B00101010,B00100100,B00000000,LETEND}, // s
{B01111100,B00100010,B00000010,B00000000,LETEND}, // t
{B00111100,B00000010,B00111110,B00000000,LETEND}, // u
{B00111000,B00000110,B00111000,B00000000,LETEND}, // v
{B00111100,B00000010,B00001100,B00000010,B00111100,B00000000,LETEND}, // w
{B00110110,B00001000,B00110110,B00000000,LETEND}, // x
{B00111001,B00000101,B00111110,B00000000,LETEND}, // y
{B00100110,B00101010,B00110010,B00000000,LETEND}, // z
{B11111010,B00000000,LETEND}, // !
{B11000000,B00000000,B11000000,B00000000,LETEND}, // "
{B00100100,B01111110,B00100100,B01111110,B00100100,B00000000,LETEND}, // #
{B01110100,B01010100,B11111110,B01010100,B01011100,B00000000,LETEND}, // $
{B01100010,B01100100,B00001000,B00010000,B00100110,B01000110,B00000000,LETEND}, // %
{B00001100,B01010010,B10100010,B01010010,B00001100,B00010010,B00000000,LETEND}, // &
{B10000000,B01000000,B00000000,LETEND}, // '
{B01111110,B10000001,B00000000,LETEND}, // (
{B10000001,B01111110,B00000000,LETEND}, // )
{B00010000,B01010100,B00111000,B01010100,B00010000,B00000000,LETEND}, // *
{B00010000,B00010000,B01111100,B00010000,B00010000,B00000000,LETEND}, // +
{B00000001,B00000010,B00000000,LETEND}, // ,
{B00010000,B00010000,B00010000,B00010000,B00000000,LETEND}, // -
{B00000010,B00000000,LETEND}, // .
{B00000010,B00000100,B00001000,B00010000,B00100000,B01000000,B00000000,LETEND}, // /
{B00100010,B00000000,LETEND}, // :
{B00000001,B00100010,B00000000,LETEND}, // ;
{B00010000,B00101000,B01000100,B10000010,B00000000,LETEND}, // <
{B00100010,B00100010,B00100010,B00000000,LETEND}, // =
{B10000010,B01000010,B00101000,B00010000,B00000000,LETEND}, // >
{B01000000,B10000000,B10001101,B10010000,B01100000,B00000000,LETEND}, // ?
{B01111100,B10000010,B10111010,B10111010,B10001010,B01111010,B00000000,LETEND}, // @
{B01111100,B10000010,B10000010,B01111100,B00000000,LETEND}, // 0
{B00100010,B01000010,B11111110,B00000010,B00000010,B00000000,LETEND}, // 1
{B01000010,B10000110,B10001010,B10010010,B10100010,B01000010,B00000000,LETEND}, // 2
{B01000100,B10000010,B10010010,B01101100,B00000000,LETEND}, // 3
{B11110000,B00010000,B00111110,B00000000,LETEND}, // 4
{B11110010,B10010010,B10010010,B10010010,B10001100,B00000000,LETEND}, // 5
{B01111100,B10010010,B10010010,B01001100,B00000000,LETEND}, // 6
{B10000000,B10001110,B10110000,B11000000,B00000000,LETEND}, // 7
{B01101100,B10010010,B10010010,B01101100,B00000000,LETEND}, // 8
{B01100000,B10010010,B10010010,B01111100,B00000000,LETEND}, // 9
};
/**
All the numbers in the world.
*/
const uint8_t Gamer::allNumbers[10][8] PROGMEM = {
{ B00000010,B00000101,B00000101,B00000101,B00000101,B00000101,B00000101,B00000010 },
{ B00000010,B00000110,B00000010,B00000010,B00000010,B00000010,B00000010,B00000111 },
{ B00000010,B00000101,B00000001,B00000010,B00000010,B00000100,B00000100,B00000111 },
{ B00000111,B00000001,B00000001,B00000110,B00000001,B00000001,B00000101,B00000010 },
{ B00000100,B00000101,B00000101,B00000111,B00000001,B00000001,B00000001,B00000001 },
{ B00000111,B00000100,B00000100,B00000110,B00000001,B00000001,B00000101,B00000010 },
{ B00000011,B00000100,B00000100,B00000110,B00000101,B00000101,B00000101,B00000010 },
{ B00000111,B00000001,B00000001,B00000010,B00000010,B00000100,B00000100,B00000100 },
{ B00000010,B00000101,B00000101,B00000010,B00000101,B00000101,B00000101,B00000010 },
{ B00000010,B00000101,B00000101,B00000011,B00000001,B00000001,B00000001,B00000110 }
};