Go Down

Topic: [SOLVED] 2x Shift Registers with 3 Digits 7 Segment display (Read 1 time) previous topic - next topic

PaulRB

Instead of:

Code: [Select]

    switch (i) {
      case 1: //
        SPI.transfer(digits[0]);
        break;

      case 2: //
        SPI.transfer(digits[1]);
        break;

      case 3: //
        SPI.transfer(digits[2]);
        break;
    }


why not just:

Code: [Select]

    SPI.transfer(digits[i-1]);

Go Up