I have a 7-segment module like this:
The IC used here isn't 74HC595 (though CMIIW), and if I tried a code like this (which is used in some examples), only the 0 one worked properly, but not any of the other numbers (1-9):
#include "Wire.h"
#define LATCH 10
#define CLK 11
#define DATA 12
byte digit[10]= {0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x7, 0x7F, 0x6F};
int i;
void setup(){
pinMode(LATCH, OUTPUT);
pinMode(CLK, OUTPUT);
pinMode(DATA, OUTPUT);
}
void loop(){
for(int i=0; i<10; i++){
for(int j=0; j<10; j++){
for(int k=0; k<10; k++){
shiftOut(DATA, CLK, MSBFIRST, ~digit[k]); // digit3
shiftOut(DATA, CLK, MSBFIRST, ~digit[j]); // digit2
shiftOut(DATA, CLK, MSBFIRST, ~digit[i]); // digit1
digitalWrite(LATCH, HIGH);
delay(50);
}
}
}
}
Can these type of 7-segment module work with Arduino IDE? If it can, how to make the proper code in Arduino IDE that works with it?




