itsmetheuglykid:
I'm using the keyestudio Mega 2560.
IDE v. 1.8.5
OS Windows 10 x64
Wiring diagram is pretty simple. VCC to 5v, GND to GND, CLK to pin 3, & DIO to pin 4.
I bought 2 from Robotdyn and 2 on Amazon. All 4 have the same issue.
https://robotdyn.com/catalog/segment/6_digit_led_display_tube_7_segments_76x19mm_tm1637/
Just a quick little code I slapped on there just to test the display.
#include "SevenSegmentTM1637.h"
SevenSegmentTM1637 ils(3,4);
void setup() {
ils.begin();
ils.print("888888");
}
void loop() {
}
All 4 of these units malfunction.
[7SEG 1](https://ibb.co/ngVPgb)
[7SEG 2](https://ibb.co/eNPd7G)
[7SEG 3](https://ibb.co/fYmrSG)
[7SEG 4](https://ibb.co/imd5nG)
Okay i see several thing in the photographs.
While this is not a true Arduino Mega2560 hopefully it is a good clone.
The Arduino Mega2560 uses pins 20 & 21 for SPI. Pin 20 is SDA and Pin 21 is SCL
you are using Pin 3 & 4 for SPI I would suggest using Pin 20 & Pin 21.
THe Schematic for the display shows that SDA and SCL have pull-up resistors on them.
Which TM1637 Library are you using?
There is this TM1637 library.
There is also the Arduino pages
http://playground.arduino.cc/Main/TM1637
I wonder if the Mega2560 is able to provide enough power to these displays.
Have you tried these displays while being powered from a separate 5volt power supply?
Make sure the grounds are tied together. floating grounds cause all sorts of issues.
Switch the SPI pins and use the github avishorp TM1637 library.
that should help.