示例#1
0
void MD_MAX72XX::controlLibrary(controlRequest_t mode, int value)
// control command was internal, set required parameters
{
  switch (mode)
  {
    case UPDATE:
      _updateEnabled = (value == ON);
    if (_updateEnabled) flushBufferAll();
      break;

    case WRAPAROUND:
      _wrapAround = (value == ON);
      break;
  }
}
uint8_t MD_MAX72XX::setChar(uint16_t col, uint8_t c)
{
  PRINT("\nsetChar: '", c);
  PRINT("' column ", col);
  boolean	b = _updateEnabled;

  uint16_t offset = getFontCharOffset(c);
  uint8_t size = pgm_read_byte(_fontData+offset);

  offset++;	// skip the size byte  

  _updateEnabled = false;
  for (int8_t i=0; i<size; i++) 
  {
    uint8_t colData = pgm_read_byte(_fontData+offset+i);
	setColumn(col--, colData);
  }
  _updateEnabled = b;

  if (_updateEnabled) flushBufferAll();

  return(size);
}