RSeries astromech firmware
MagicPanel.h
Go to the documentation of this file.
1 #ifndef MagicPanel_h
2 #define MagicPanel_h
3 
4 #include "ReelTwo.h"
5 #include "core/SetupEvent.h"
6 #include "core/AnimatedEvent.h"
7 #include "core/CommandEvent.h"
9 
23 {
24 public:
28  MagicPanelBase(LedControl& ledControl) :
29  fLC(ledControl),
30  fDisplayEffect(kNormal),
31  fPreviousEffect(~fDisplayEffect),
32  fFlipFlop(false),
33  fFlipFlopLast(false),
34  fStatusDelay(1000),
35  fStatusMillis(0),
36  fEffectSeqCount(0),
37  fEffectSeqDir(0),
38  fPrevEffectSeqCount(0),
39  fEffectLengthMillis(0),
40  fEffectStartMillis(0),
41  fDisplayEffectVal(0)
42  {
43  fLC.setAllPower(true);
44  }
45 
47  {
49  };
50 
51  enum Sequence
52  {
53  kNormal = 0,
54  kSolid = 1,
55  kToggle = 2,
56  kFlash = 3,
57  kAlert = 4,
60  kLife = 7,
65  kForwardQ = 12,
66  kReverseQ = 13,
68  };
69 
73  virtual void setup() override
74  {
75  selectEffect(80000 + 100);
76  fStatusMillis = millis();
77  }
78 
86  void selectEffect(long inputNum)
87  {
88  fDisplayEffectVal = inputNum;
89  }
90 
108  virtual void handleCommand(const char* cmd) override
109  {
110  if (*cmd++ == 'M' && *cmd++ == 'P')
111  {
112  long int cmdvalue = 0;
113  const char* c = cmd;
114  while (*c >= '0' && *c <= '9')
115  {
116  cmdvalue = cmdvalue * 10 + (*c++ - '0');
117  }
118  selectEffect(cmdvalue);
119  }
120  }
121 
125  inline void setSequence(Sequence seq = kNormal, uint8_t speedScale = 0, uint8_t numSeconds = 0)
126  {
127  selectEffect((long int)seq * 10000L + (long int)speedScale * 100 + numSeconds);
128  }
129 
133  virtual void animate() override
134  {
135  bool timerExpired = false;
136  unsigned long currentMillis = millis();
137  if (currentMillis - fStatusMillis >= fStatusDelay)
138  {
139  timerExpired = true;
140  fStatusMillis = currentMillis;
141  fFlipFlop = !fFlipFlop;
142  fEffectSeqCount += fEffectSeqDir;
143  randomSeed(analogRead(A0));
144  }
145 
146  int selectSequence = (fDisplayEffectVal % 1000000) / 10000;
147  // 100ms - 9s
148  int selectSpeed = (fDisplayEffectVal % 10000) / 100;
149  int selectLength = (fDisplayEffectVal % 100);
150  int defaultSpeed = 200;
151 
152  switch (selectSequence)
153  {
154  case kNormal:
155  case kSolid:
156  case kToggle:
157  defaultSpeed = 1000;
158  break;
159  case kFlash:
160  case kHorizontalScan:
161  case kVerticalScan:
162  case kExpandSolid:
163  case kExpandHollow:
164  case kForwardQ:
165  case kCollapseSolid:
166  case kCollapseHollow:
167  case kReverseQ:
168  case kLife:
169  break;
170  case kCistercian:
171  defaultSpeed = 1000;
172  break;
173  case kAlert:
174  selectSequence = kForwardQ;
175  defaultSpeed = 100;
176  break;
177  default:
178  selectSequence = kNormal;
179  defaultSpeed = 1000;
180  break;
181  }
182  fDisplayEffect = selectSequence;
183  if (fPreviousEffect != fDisplayEffect)
184  {
185  timerExpired = true;
186  fEffectSeqDir = +1;
187  fEffectSeqCount = 0;
188  switch (selectSequence)
189  {
190  case kCollapseSolid:
191  case kCollapseHollow:
192  case kReverseQ:
193  // move frame to end of sequence
194  fEffectSeqDir = -1;
195  fEffectSeqCount = 0x7FFF;
196  break;
197  }
198  fPrevEffectSeqCount = 0;
199  fStatusDelay = (selectSpeed) ? 100 * (selectSpeed) : defaultSpeed;
200  fEffectStartMillis = currentMillis;
201  fEffectLengthMillis = selectLength * 1000;
202  fLC.clearAllDisplays();
203  }
204  unsigned int effectMillis = currentMillis - fEffectStartMillis;
205  if (timerExpired)
206  {
207  switch (fDisplayEffect)
208  {
209  case kNormal:
210  /* Do nothing */
211  break;
212  case kSolid:
213  {
214  if (fPreviousEffect != fDisplayEffect)
215  {
216  for (int i = 0; i < 8; i++)
217  setRow(i, B11111111);
218  }
219  break;
220  }
221  case kToggle:
222  {
223  int i;
224  for (i = 0; i < 4; i++)
225  setRow(i, (!fFlipFlop) ? B11111111 : B00000000);
226  for (; i < 8; i++)
227  setRow(i, (!fFlipFlop) ? B00000000 : B11111111);
228  break;
229  }
230  case kFlash:
231  {
232  if (!fFlipFlop)
233  {
234  for (int i = 0; i < 8; i++)
235  setRow(i, B11111111);
236  }
237  else
238  {
239  for (int i = 0; i < 8; i++)
240  setRow(i, B00000000);
241  }
242  break;
243  }
244  case kHorizontalScan:
245  {
246  if (fPrevEffectSeqCount != fEffectSeqCount)
247  setCol(fPrevEffectSeqCount, 0);
248  if (fEffectSeqCount > 7)
249  {
250  fEffectSeqDir = -1;
251  fEffectSeqCount += fEffectSeqDir;
252  }
253  else if (fEffectSeqCount < 0)
254  {
255  fEffectSeqDir = +1;
256  fEffectSeqCount += fEffectSeqDir;
257  }
258  setCol(fEffectSeqCount, 1);
259  break;
260  }
261  case kVerticalScan:
262  {
263  if (fPrevEffectSeqCount != fEffectSeqCount)
264  setRow(fPrevEffectSeqCount, B00000000);
265  if (fEffectSeqCount > 7)
266  {
267  fEffectSeqDir = -1;
268  fEffectSeqCount += fEffectSeqDir;
269  }
270  else if (fEffectSeqCount < 0)
271  {
272  fEffectSeqDir = +1;
273  fEffectSeqCount += fEffectSeqDir;
274  }
275  setRow(fEffectSeqCount, B11111111);
276  break;
277  }
278  case kLife:
279  {
280  if (fPreviousEffect != fDisplayEffect)
281  {
282  for (int i = 0; i < 8; i++)
283  setRow(i, random(255));
284  }
285  play();
286  bool empty = true;
287  for (int y = 0; y < 8; y++)
288  {
289  if (getRow(y) != 0)
290  {
291  empty = false;
292  break;
293  }
294  }
295  if (empty)
296  {
297  selectEffect(30000 + 100 + 2);
298  }
299  else
300  {
301  setPixel(random(8), random(8), 1);
302  }
303  break;
304  }
305  case kExpandSolid:
306  case kCollapseSolid:
307  {
308  const byte* ptr = getFrame_ExpandSolid(fEffectSeqCount, fEffectSeqDir);
309  for (int i = 0; i < 8; i++, ptr++)
310  {
311  setRow(i, pgm_read_byte(ptr));
312  }
313  break;
314  }
315  case kExpandHollow:
316  case kCollapseHollow:
317  {
318  const byte* ptr = getFrame_ExpandHollow(fEffectSeqCount, fEffectSeqDir);
319  for (int i = 0; i < 8; i++, ptr++)
320  {
321  setRow(i, pgm_read_byte(ptr));
322  }
323  break;
324  }
325  case kForwardQ:
326  case kReverseQ:
327  {
328  const byte* ptr = getFrame_Q(fEffectSeqCount, fEffectSeqDir);
329  for (int i = 0; i < 8; i++, ptr++)
330  {
331  setRow(i, pgm_read_byte(ptr));
332  }
333  break;
334  }
335  case kCistercian:
336  {
337  unsigned count = fEffectSeqCount;
338  unsigned thousands = count / 1000;
339  count -= thousands*1000;
340  unsigned hundreds = count / 100;
341  count -= hundreds*100;
342  unsigned tens = count / 10;
343  count -= tens*10;
344  unsigned ones = count;
345  DEBUG_PRINT(thousands); DEBUG_PRINT(' ');
346  DEBUG_PRINT(hundreds); DEBUG_PRINT(' ');
347  DEBUG_PRINT(tens); DEBUG_PRINT(' ');
348  DEBUG_PRINTLN(ones);
349  byte frame[8];
350  memset(frame, '\0', sizeof(frame));
351  if (thousands != 0)
352  {
353  const byte* ptr = getFrame_Cistercian(thousands*1000);
354  for (int i = 0; i < 8; i++, ptr++)
355  {
356  frame[i] |= pgm_read_byte(ptr);
357  }
358  }
359  if (hundreds != 0)
360  {
361  const byte* ptr = getFrame_Cistercian(hundreds*100);
362  for (int i = 0; i < 8; i++, ptr++)
363  {
364  frame[i] |= pgm_read_byte(ptr);
365  }
366  }
367  if (tens != 0)
368  {
369  const byte* ptr = getFrame_Cistercian(tens*10);
370  for (int i = 0; i < 8; i++, ptr++)
371  {
372  frame[i] |= pgm_read_byte(ptr);
373  }
374  }
375  if (ones != 0)
376  {
377  const byte* ptr = getFrame_Cistercian(ones);
378  for (int i = 0; i < 8; i++, ptr++)
379  {
380  frame[i] |= pgm_read_byte(ptr);
381  }
382  }
383  for (int i = 0; i < 8; i++)
384  {
385  setRow(i, frame[i]);
386  }
387  break;
388  }
389  }
390  fPrevEffectSeqCount = fEffectSeqCount;
391  }
392  if (fEffectLengthMillis > 0 && fEffectLengthMillis < effectMillis)
393  {
394  selectEffect(kNormalVal); //go back to normal operation if its time
395  }
396  fPreviousEffect = fDisplayEffect;
397  }
398 
399 private:
400  LedControl& fLC;
401  unsigned long fDisplayEffect;
402  unsigned long fPreviousEffect;
403  bool fFlipFlop;
404  bool fFlipFlopLast;
405  unsigned long fStatusDelay;
406  unsigned long fStatusMillis;
407  int fEffectSeqCount;
408  int fEffectSeqDir;
409  int fPrevEffectSeqCount;
410  unsigned int fEffectLengthMillis;
411  unsigned long fEffectStartMillis;
412  unsigned long fDisplayEffectVal;
413 
414  void setRow(int row, uint8_t bits)
415  {
416  row *= 2;
417  byte device = (row / 8);
418  row %= 8;
419  fLC.setRow(device, row, (byte)((bits >> 4) << 4));
420  fLC.setRow(device, row+1, (byte)(bits & 0XF));
421  }
422 
423  byte getRow(int y)
424  {
425  y *= 2;
426  byte device = (y / 8);
427  y %= 8;
428  return fLC.getRow(device, y) |
429  fLC.getRow(device, y+1);
430  }
431 
432  byte getPixel(int x, int y)
433  {
434  y *= 2;
435  byte device = (y / 8);
436  y %= 8;
437  if (x < 4)
438  {
439  byte bits = fLC.getRow(device, y) >> 4;
440  return ((bits & (1<<(3-x))) != 0);
441  }
442  else
443  {
444  byte bits = fLC.getRow(device, y+1);
445  return ((bits & (1<<(7-x))) != 0);
446  }
447  }
448 
449  void setPixel(int x, int y, uint8_t set)
450  {
451  y *= 2;
452  byte device = (y / 8);
453  y %= 8;
454  if (x < 4)
455  {
456  byte bits = fLC.getRow(device, y) >> 4;
457  bits = (set) ? (bits | (1<<(3-x))) : (bits & ~(1<<(3-x)));
458  bits <<= 4;
459  fLC.setRow(device, y, (byte)((bits >> 4) << 4));
460  }
461  else
462  {
463  byte bits = fLC.getRow(device, y+1);
464  bits = (set) ? (bits | (1<<(7-x))) : (bits & ~(1<<(7-x)));
465  fLC.setRow(device, y+1, (byte)(bits & 0XF));
466  }
467  }
468 
469  void setCol(int col, uint8_t bit)
470  {
471  for (int y = 0; y < 8; y++)
472  {
473  setPixel(col, y, bit);
474  }
475  }
476 
477  static const byte* getFrame_Cistercian(unsigned number)
478  {
479  static const byte sFrameData[] PROGMEM = {
481  B00001111,
482  B00001000,
483  B00001000,
484  B00001000,
485  B00001000,
486  B00001000,
487  B00001000,
488  B00001000,
490  B00001000,
491  B00001000,
492  B00001000,
493  B00001111,
494  B00001000,
495  B00001000,
496  B00001000,
497  B00001000,
499  B00001000,
500  B00001100,
501  B00001010,
502  B00001001,
503  B00001000,
504  B00001000,
505  B00001000,
506  B00001000,
508  B00001001,
509  B00001010,
510  B00001100,
511  B00001000,
512  B00001000,
513  B00001000,
514  B00001000,
515  B00001000,
517  B00001111,
518  B00001010,
519  B00001100,
520  B00001000,
521  B00001000,
522  B00001000,
523  B00001000,
524  B00001000,
526  B00001001,
527  B00001001,
528  B00001001,
529  B00001001,
530  B00001000,
531  B00001000,
532  B00001000,
533  B00001000,
535  B00001111,
536  B00001001,
537  B00001001,
538  B00001001,
539  B00001000,
540  B00001000,
541  B00001000,
542  B00001000,
544  B00001001,
545  B00001001,
546  B00001001,
547  B00001111,
548  B00001000,
549  B00001000,
550  B00001000,
551  B00001000,
553  B00001111,
554  B00001001,
555  B00001001,
556  B00001111,
557  B00001000,
558  B00001000,
559  B00001000,
560  B00001000,
562  B01111000,
563  B00001000,
564  B00001000,
565  B00001000,
566  B00001000,
567  B00001000,
568  B00001000,
569  B00001000,
571  B00001000,
572  B00001000,
573  B00001000,
574  B01111000,
575  B00001000,
576  B00001000,
577  B00001000,
578  B00001000,
580  B00001000,
581  B00011000,
582  B00101000,
583  B01001000,
584  B00001000,
585  B00001000,
586  B00001000,
587  B00001000,
589  B01001000,
590  B00101000,
591  B00011000,
592  B00001000,
593  B00001000,
594  B00001000,
595  B00001000,
596  B00001000,
598  B01111000,
599  B00101000,
600  B00011000,
601  B00001000,
602  B00001000,
603  B00001000,
604  B00001000,
605  B00001000,
607  B01001000,
608  B01001000,
609  B01001000,
610  B01001000,
611  B00001000,
612  B00001000,
613  B00001000,
614  B00001000,
616  B01111000,
617  B01001000,
618  B01001000,
619  B01001000,
620  B00001000,
621  B00001000,
622  B00001000,
623  B00001000,
625  B01001000,
626  B01001000,
627  B01001000,
628  B01111000,
629  B00001000,
630  B00001000,
631  B00001000,
632  B00001000,
634  B01111000,
635  B01001000,
636  B01001000,
637  B01111000,
638  B00001000,
639  B00001000,
640  B00001000,
641  B00001000,
643  B00001000,
644  B00001000,
645  B00001000,
646  B00001000,
647  B00001000,
648  B00001000,
649  B00001000,
650  B00001111,
652  B00001000,
653  B00001000,
654  B00001000,
655  B00001000,
656  B00001111,
657  B00001000,
658  B00001000,
659  B00001000,
661  B00001000,
662  B00001000,
663  B00001000,
664  B00001000,
665  B00001001,
666  B00001010,
667  B00001100,
668  B00001000,
670  B00001000,
671  B00001000,
672  B00001000,
673  B00001000,
674  B00001000,
675  B00001100,
676  B00001010,
677  B00001001,
679  B00001000,
680  B00001000,
681  B00001000,
682  B00001000,
683  B00001000,
684  B00001100,
685  B00001010,
686  B00001111,
688  B00001000,
689  B00001000,
690  B00001000,
691  B00001000,
692  B00001001,
693  B00001001,
694  B00001001,
695  B00001001,
697  B00001000,
698  B00001000,
699  B00001000,
700  B00001000,
701  B00001001,
702  B00001001,
703  B00001001,
704  B00001111,
706  B00001000,
707  B00001000,
708  B00001000,
709  B00001000,
710  B00001111,
711  B00001001,
712  B00001001,
713  B00001001,
715  B00001000,
716  B00001000,
717  B00001000,
718  B00001000,
719  B00001111,
720  B00001001,
721  B00001001,
722  B00001111,
724  B00001000,
725  B00001000,
726  B00001000,
727  B00001000,
728  B00001000,
729  B00001000,
730  B00001000,
731  B01111000,
733  B00001000,
734  B00001000,
735  B00001000,
736  B00001000,
737  B01111000,
738  B00001000,
739  B00001000,
740  B00001000,
742  B00001000,
743  B00001000,
744  B00001000,
745  B00001000,
746  B01001000,
747  B00101000,
748  B00011000,
749  B00001000,
751  B00001000,
752  B00001000,
753  B00001000,
754  B00001000,
755  B00001000,
756  B00011000,
757  B00101000,
758  B01001000,
760  B00001000,
761  B00001000,
762  B00001000,
763  B00001000,
764  B00001000,
765  B00011000,
766  B00101000,
767  B01111000,
769  B00001000,
770  B00001000,
771  B00001000,
772  B00001000,
773  B01001000,
774  B01001000,
775  B01001000,
776  B01001000,
778  B00001000,
779  B00001000,
780  B00001000,
781  B00001000,
782  B01001000,
783  B01001000,
784  B01001000,
785  B01111000,
787  B00001000,
788  B00001000,
789  B00001000,
790  B00001000,
791  B01111000,
792  B01001000,
793  B01001000,
794  B01001000,
796  B00001000,
797  B00001000,
798  B00001000,
799  B00001000,
800  B01111000,
801  B01001000,
802  B01001000,
803  B01111000,
804  };
805  unsigned ln = log10(number);
806  DEBUG_PRINT("number: "); DEBUG_PRINT(number);
807  if (ln > 0)
808  number /= (ln*10);
809  DEBUG_PRINT(" frame: "); DEBUG_PRINTLN((number-1)+ln*9);
810  return &sFrameData[((number-1)+ln*9)*8];
811  }
812 
813  static const byte* getFrame_ExpandSolid(int &frameIndex, int direction)
814  {
815  static const byte sFrameData[] PROGMEM = {
816  B00000000,
817  B00000000,
818  B00000000,
819  B00011000,
820  B00011000,
821  B00000000,
822  B00000000,
823  B00000000,
825  B00000000,
826  B00000000,
827  B00111100,
828  B00111100,
829  B00111100,
830  B00111100,
831  B00000000,
832  B00000000,
834  B00000000,
835  B01111110,
836  B01111110,
837  B01111110,
838  B01111110,
839  B01111110,
840  B01111110,
841  B00000000,
843  B11111111,
844  B11111111,
845  B11111111,
846  B11111111,
847  B11111111,
848  B11111111,
849  B11111111,
850  B11111111
851  };
852  unsigned frameCount = sizeof(sFrameData) / 8;
853  if (unsigned(frameIndex) >= frameCount)
854  frameIndex = (direction > 0) ? 0 : frameCount-1;
855  return &sFrameData[frameIndex*8];
856  }
857 
858  static const byte* getFrame_ExpandHollow(int &frameIndex, int direction)
859  {
860  static const byte sFrameData[] PROGMEM = {
861  B00000000,
862  B00000000,
863  B00000000,
864  B00011000,
865  B00011000,
866  B00000000,
867  B00000000,
868  B00000000,
870  B00000000,
871  B00000000,
872  B00111100,
873  B00100100,
874  B00100100,
875  B00111100,
876  B00000000,
877  B00000000,
879  B00000000,
880  B01111110,
881  B01000010,
882  B01000010,
883  B01000010,
884  B01000010,
885  B01111110,
886  B00000000,
888  B11111111,
889  B10000001,
890  B10000001,
891  B10000001,
892  B10000001,
893  B10000001,
894  B10000001,
895  B11111111,
897  B00000000,
898  B00000000,
899  B00000000,
900  B00000000,
901  B00000000,
902  B00000000,
903  B00000000,
904  B00000000
905  };
906  unsigned frameCount = sizeof(sFrameData) / 8;
907  if (unsigned(frameIndex) >= frameCount)
908  frameIndex = (direction > 0) ? 0 : frameCount-1;
909  return &sFrameData[frameIndex*8];
910  }
911 
912  static const byte* getFrame_Q(int &frameIndex, int direction)
913  {
914  static const byte sFrameData[] PROGMEM = {
915  B00001111,
916  B00001111,
917  B00001111,
918  B00001111,
919  B11110000,
920  B11110000,
921  B11110000,
922  B11110000,
924  B11110000,
925  B11110000,
926  B11110000,
927  B11110000,
928  B00001111,
929  B00001111,
930  B00001111,
931  B00001111
932  };
933  unsigned frameCount = sizeof(sFrameData) / 8;
934  if (unsigned(frameIndex) >= frameCount)
935  frameIndex = (direction > 0) ? 0 : frameCount-1;
936  return &sFrameData[frameIndex*8];
937  }
938 
939  static inline int wrap(int i, int a)
940  {
941  i += a;
942  while (i < 0)
943  i += 8;
944  while (i >= 8)
945  i -= 8;
946  return i;
947  }
948 
949  void play()
950  {
951  byte newbits[8];
952  for (int y = 0; y < 8; y++)
953  {
954  newbits[y] = 0;
955  for (int x = 0; x < 8; x++)
956  {
957  int a = 0;
958  for (int k = -1; k <= 1; k++)
959  {
960  for (int l = -1; l <= 1; l++)
961  {
962  if (k || l)
963  {
964  a += getPixel(wrap(x, k), wrap(y, l));
965  }
966  }
967  }
968  if (a == 2) newbits[y] |= (getPixel(x, y)<<(7-x));
969  if (a == 3) newbits[y] |= (1<<(7-x));
970  }
971  }
972  for (int y = 0; y < 8; y++)
973  {
974  setRow(y, newbits[y]);
975  }
976  }
977 };
978 
993 class MagicPanel :
994  protected LedControlMAX7221<2>,
995  public MagicPanelBase
996 {
997 public:
1001  MagicPanel(byte dataPin = 8, byte clkPin = 7, byte csPin = 6) :
1002  LedControlMAX7221<2>(dataPin, clkPin, csPin),
1003  MagicPanelBase((LedControl&)*this)
1004  {
1005  }
1006 };
1007 #endif
MagicPanelBase::kCollapseSolid
@ kCollapseSolid
Definition: MagicPanel.h:62
MagicPanelBase::selectEffect
void selectEffect(long inputNum)
Select the specified effect using a 32-bit integer.
Definition: MagicPanel.h:86
MagicPanelBase::kExpandHollow
@ kExpandHollow
Definition: MagicPanel.h:63
CommandEvent
Base class for all command enabled devices. CommandEvent::handleCommand() is called for each device e...
Definition: CommandEvent.h:17
MagicPanelBase::kFlash
@ kFlash
Definition: MagicPanel.h:56
MagicPanelBase::kNormalVal
@ kNormalVal
Definition: MagicPanel.h:48
MagicPanelBase::Sequence
Sequence
Definition: MagicPanel.h:51
MagicPanelBase::kForwardQ
@ kForwardQ
Definition: MagicPanel.h:65
DEBUG_PRINT
#define DEBUG_PRINT(s)
Definition: ReelTwo.h:189
MagicPanelBase::kAlert
@ kAlert
Definition: MagicPanel.h:57
ReelTwo.h
SetupEvent.h
AnimatedEvent
Base class for all animated devices. AnimatedEvent::animate() is called for each device once through ...
Definition: AnimatedEvent.h:18
MagicPanelBase::EffectValue
EffectValue
Definition: MagicPanel.h:46
SetupEvent
Base class for all devices that require setup that cannot happen in the constructor....
Definition: SetupEvent.h:15
MagicPanelBase::kToggle
@ kToggle
Definition: MagicPanel.h:55
LedControlMAX7221.h
AnimatedEvent.h
MagicPanelBase::kSolid
@ kSolid
Definition: MagicPanel.h:54
MagicPanelBase::kCistercian
@ kCistercian
Definition: MagicPanel.h:67
DEBUG_PRINTLN
#define DEBUG_PRINTLN(s)
Definition: ReelTwo.h:188
MagicPanelBase::setSequence
void setSequence(Sequence seq=kNormal, uint8_t speedScale=0, uint8_t numSeconds=0)
Select the specified effect sequence.
Definition: MagicPanel.h:125
MagicPanelBase::kVerticalScan
@ kVerticalScan
Definition: MagicPanel.h:59
MagicPanelBase::kCollapseHollow
@ kCollapseHollow
Definition: MagicPanel.h:64
LedControlMAX7221
LED MAX7221 device chain.
Definition: LedControlMAX7221.h:129
MagicPanelBase::kLife
@ kLife
Definition: MagicPanel.h:60
MagicPanelBase::kExpandSolid
@ kExpandSolid
Definition: MagicPanel.h:61
MagicPanelBase::kNormal
@ kNormal
Definition: MagicPanel.h:53
MagicPanelBase::setup
virtual void setup() override
Perform any initialzation not possible in the constructor.
Definition: MagicPanel.h:73
MagicPanelBase
Base class for Magic Panel.
Definition: MagicPanel.h:21
MagicPanelBase::MagicPanelBase
MagicPanelBase(LedControl &ledControl)
Default Constructor.
Definition: MagicPanel.h:28
MagicPanelBase::kHorizontalScan
@ kHorizontalScan
Definition: MagicPanel.h:58
MagicPanelBase::handleCommand
virtual void handleCommand(const char *cmd) override
MP00000 - Normal MP10000 - Solid MP20000 - Toggle MP30000 - Flash MP40000 - Alert MP50000 - Horizonta...
Definition: MagicPanel.h:108
MagicPanelBase::animate
virtual void animate() override
Perform a single frame of LED animation based on the selected sequence.
Definition: MagicPanel.h:133
CommandEvent.h
MagicPanel::MagicPanel
MagicPanel(byte dataPin=8, byte clkPin=7, byte csPin=6)
Default Constructor.
Definition: MagicPanel.h:1001
MagicPanel
Magic Panel by ia-parts.com.
Definition: MagicPanel.h:993
MagicPanelBase::kReverseQ
@ kReverseQ
Definition: MagicPanel.h:66