code: function(n, segments, callback) {
      if (n < 0 || n > 7) {
        throw "Invalid digit number";
      }
      if (segments.length != 8) {
        throw "Invalid segments array";
      }
      this.setDigitSegmentsByte(n, this.encodeByte(segments), callback);
    }
docs: Sets each segment in a digit on/off.
  For this to work properly, the digit should be in no-decode mode.
  
  The segments are identified as follows:
  _a_
  f|   |b
  |_g_|
  |   |
  e|___|c  dp (decimal point)
  d    *
  
  @param number n
  The digit number, from 0 up to and including 7.
  @param array segments
  A list specifying whether segments are on and off.
  E.g., to specify dp, c, d, e and g on, and a, b, f off,
  segments would be [1, 0, 0, 1, 1, 1, 0, 1], corresponding
  to the structure [dp, a, b, c, d, e, f, g].
  
  @param function callback [optional]
  Invoked once the write to the SPI device finishes.