با سلام خدمت کاربران محترم. بنده این محصول رو خریداری کردم. کد فوق رو هم روی میکروکنترلر برنامه ریزی کردم اما کد به درستی عمل نکرد. کد زیر رو برای آردینو نوشتم. قابلیت اتصال صحیح رو داره برای تست ماژول.
ضمنا توجه کنید در آدرس ها، چون این ماژول از 4 شیفت رجیستر کمک می گیره، طبق نقشه، 8 بیت اول که ارسال میشه آدرس مربوط به خروجی های هر عدد سون سگمنت هست، 8 بیت بعدی سگمنت ها رو روشن می کنه (سون سگمنت بالایی) و به همین ترتیب سون سگمنت پایینی. توجه کنید سون سگمنت بالایی کاتد مشترک و سون سگمنت پایینی آند مشترک هستش.

کد برنامه
در سمت ورودی ماژول که با in مشخص شده، vcc به 5 ولت، sclk به پین 12، rclk به پین 8، dio به پین 11 آردینو و نهایتا gnd به زمین یا منفی متصل گردد.

//in the name of allah

//pin connected to st_cp of 74hc595
int latchpin = 8;
//pin connected to sh_cp of 74hc595
int clockpin = 12;
////pin connected to ds of 74hc595
int datapin = 11;

int num[10]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6 f};
void setup()
{
//set pins to output so you can control the shift register
pinmode(latchpin, output);
pinmode(clockpin, output);
pinmode(datapin, output);
}

void loop()
{
for(int i = 0; i < 10; i++)
{
for(int j = 0; j <= 20; j++)
{

digitalwrite(latchpin, low);

shiftout(datapin, clockpin, msbfirst, 254);
shiftout(datapin, clockpin, msbfirst, num[i]);

shiftout(datapin, clockpin, msbfirst, ~254);
shiftout(datapin, clockpin, msbfirst, ~num[2]);
digitalwrite(latchpin, high);
delay(4);

digitalwrite(latchpin, low);

shiftout(datapin, clockpin, msbfirst, 253);
shiftout(datapin, clockpin, msbfirst, num[3]);

shiftout(datapin, clockpin, msbfirst, ~253);
shiftout(datapin, clockpin, msbfirst, ~num[i]);
digitalwrite(latchpin, high);
delay(4);

digitalwrite(latchpin, low);

shiftout(datapin, clockpin, msbfirst, 251);
shiftout(datapin, clockpin, msbfirst, num[5]);

shiftout(datapin, clockpin, msbfirst, ~251);
shiftout(datapin, clockpin, msbfirst, ~num[6]);
digitalwrite(latchpin, high);
delay(4);

digitalwrite(latchpin, low);

shiftout(datapin, clockpin, msbfirst, 247);
shiftout(datapin, clockpin, msbfirst, num[9-i]);

shiftout(datapin, clockpin, msbfirst, ~247);
shiftout(datapin, clockpin, msbfirst, ~num[9]);
digitalwrite(latchpin, high);
delay(4);
}
}
}