#define CLK 2 //Connected to TPIC pin 13: SRCLK (aka Clock) #define LATCH 3 //Connected to TPIC pin 12: RCLK (aka Latch/load/CS/SS...) #define DOUT 4 //Connected to TPIC pin 3: SER (aka MOSI) #define SEG_0 A0 #define SEG_1 A1 #define SEG_2 A2 #define SEG_3 A3 #define SEG_4 A4 #define SEG_5 A5 #define SEG_6 11 #define SEG_7 12 #define FET_COUNT 8 #define BYTE_PER_FET 6 volatile uint8_t data[FET_COUNT][BYTE_PER_FET]; long dataMillis = 0; uint8_t dataDemoStep = 0; void setup() { Serial.begin(115200); pinMode(CLK,OUTPUT); pinMode(LATCH,OUTPUT); pinMode(DOUT, OUTPUT); pinMode(SEG_0, OUTPUT); pinMode(SEG_1, OUTPUT); pinMode(SEG_2, OUTPUT); pinMode(SEG_3, OUTPUT); pinMode(SEG_4, OUTPUT); pinMode(SEG_5, OUTPUT); pinMode(SEG_6, OUTPUT); pinMode(SEG_7, OUTPUT); initializeSRData(); //Prepares SR and clears data on serial line } void loop() { if(millis() - dataMillis > 10) { static uint8_t counterFet = 0; static uint8_t counterDigit = 0; static uint8_t counterBit = 0; for(int fet=0; fet 7) { counterBit = 0; counterDigit++; if(counterDigit > 5) { counterFet++; counterDigit = 0; counterFet %= FET_COUNT; } } dataMillis = millis(); } refreshDisplay(); //Cycles through all displays and digits } void initializeSRData() { digitalWrite(LATCH,HIGH); //Tells all SRs that uController is sending data for(int digit = 0; digit < BYTE_PER_FET; digit++) { shiftOut(DOUT, CLK, LSBFIRST,0); } digitalWrite(LATCH,LOW); //Tells all SRs that uController is done sending data } void clearDisplay(int dispID) { initializeSRData(); refreshDisplay(); } void refreshDisplay() { for(int fet=0; fet