Code Example


Main code link
Animation module link
Letters module link
Symbols module link
/*
 * Code by Brian Patton
 * modified from example code included in examples for the LedControl library
 * Created 4/13/2016
 * Do whatever you wish with it
 */
//************************************************************
//*************     Symbols  Module    ***********************
//************************************************************
void prtUpArrow(int device)
{
  byte UpArrow[8] =
  {B00010000, B00100000, B01000000, B10111111, B10111111, B01000000, B00100000, B00010000};
  for (int i = 0; i < 8; i++)
  {
    lc1.setRow(device, i, UpArrow[i]); //setRow(int addr, int row, byte value);
  }
}
//***********************
void prtLeftArrow(int device)
{
  byte LeftArrow[8] =
  {B00000000, B00011000, B00011000, B00011000, B10011001, B01011010, B00100100, B00011000};
  for (int i = 0; i < 8; i++)
  {
    lc1.setRow(device, i, LeftArrow[i]); //setRow(int addr, int row, byte value);
  }
}
//***********************
void prtRightArrow(int device)
{
  byte RightArrow[8] =
  {B00011000, B00100100, B01011010, B10011001, B00011000, B00011000, B00011000, B0000000};
  for (int i = 0; i < 8; i++)
  {
    lc1.setRow(device, i, RightArrow[i]); //setRow(int addr, int row, byte value);
  }
}
//************************************************************
//****************        Characters      ********************
//************************************************************
//************************
void prtFace_Happy(int device)
{
  byte Face_Happy[8] =
  {B00000000,  B01000100,  B10100010,  B01001001,  B01001001, B10100010, B01000100, B00000000};
  for (int i = 0; i < 8; i++)
  {
    lc1.setRow(device, i, Face_Happy[i]); //setRow(int addr, int row, byte value);
  }
}
//************************
void prtFace_Sad(int device)
{
  byte Face_Sad[8] =
  { B00100000, B01000001, B10100010, B01001010, B01001010, B10100010, B01000001, B00100000};
  for (int i = 0; i < 8; i++)
  {
    lc1.setRow(device, i, Face_Sad[i]); //setRow(int addr, int row, byte value);
  }
}