Skip to main content
added 187 characters in body
Source Link
hcheung
  • 2k
  • 9
  • 16

What caused the problem of the digit that driven by pin 12 is quite obvious to me. You use pin 11, 12, 13, 14 for driving the 7-segment digits, while. While SPI library by default uses pin 10, 11, 12, 13 as SS, MOSI, MISO and SCK, and set pin 12 (MISO) as INPUT which is in conflict with your pin 12 (as an OUTPUT) for driving the 2nd digit of.

Pin 13 is also used by the displayinterval blinking LED (i.e. BUILTIN_LED) when defined as a digital i/o.

Your code uses quite a few libraries, and those libraries could uses some of the I/O pins, I would suggest you reduce your code to only the code related to SevSeg and, set the display to all '8888', and add each library one by one back to find out what caused itthe problem.

You use pin 11, 12, 13, 14 for driving the 7-segment digits, while SPI library by default uses pin 10, 11, 12, 13 as SS, MOSI, MISO and SCK, and set pin 12 (MISO) as INPUT which is in conflict with your pin 12 (as an OUTPUT) for the 2nd digit of the display.

Your code uses quite a few libraries, and those libraries could uses some of the I/O pins, I would suggest you reduce your code to only the code related to SevSeg and set the display to all '8888', and add each library one by one back to find out what caused it.

What caused the problem of the digit that driven by pin 12 is quite obvious to me. You use pin 11, 12, 13, 14 for driving the 7-segment digits. While SPI library by default uses pin 10, 11, 12, 13 as SS, MOSI, MISO and SCK, and set pin 12 (MISO) as INPUT which is in conflict with your pin 12 (as an OUTPUT) for driving the digit.

Pin 13 is also used by the interval blinking LED (i.e. BUILTIN_LED) when defined as a digital i/o.

Your code uses quite a few libraries, and those libraries could uses some of the I/O pins, I would suggest you reduce your code to only the code related to SevSeg, set the display to all '8888', and add each library one by one back to find out what caused the problem.

Source Link
hcheung
  • 2k
  • 9
  • 16

You use pin 11, 12, 13, 14 for driving the 7-segment digits, while SPI library by default uses pin 10, 11, 12, 13 as SS, MOSI, MISO and SCK, and set pin 12 (MISO) as INPUT which is in conflict with your pin 12 (as an OUTPUT) for the 2nd digit of the display.

Your code uses quite a few libraries, and those libraries could uses some of the I/O pins, I would suggest you reduce your code to only the code related to SevSeg and set the display to all '8888', and add each library one by one back to find out what caused it.