TM1638 7 segment led board - cannot get it to loop

Hello everyone

I am new to this … but am learning a little at a time

I recently started playing around with a led&key circuit board with a uno board

I think its a TM1638

I have written this code but wanted it to turn the screen off and loop again constantly
I think I have gone wrong somewhere.

so the scenario of what i wanted it to do is
light up the leds and segments as “0” which it does
and then clear the screen and do the same again over and over

const int strobe = 7;
const int clock = 9;
const int data = 8;

void sendCommand(uint8_t value)
{
digitalWrite(strobe, LOW);
shiftOut(data, clock, LSBFIRST, value);
digitalWrite(strobe, HIGH);
}

void reset()
{
sendCommand(0x40); // set auto increment mode
digitalWrite(strobe, LOW);
shiftOut(data, clock, LSBFIRST, 0xc0); // set starting address to 0
for(uint8_t i = 0; i < 16; i++)
{
shiftOut(data, clock, LSBFIRST, 0x00);
}
digitalWrite(strobe, HIGH);
}

void setup()
{
pinMode(strobe, OUTPUT);
pinMode(clock, OUTPUT);
pinMode(data, OUTPUT);

sendCommand(0x8f); // activate and set brightness to max
reset();
}

void loop()
{

sendCommand(0x44); // set single address

digitalWrite(strobe, LOW);
shiftOut(data, clock, LSBFIRST, 0x3F); // 1st segment 0x3F address is first segment 0x3F displaying 0
shiftOut(data, clock, LSBFIRST, 0x3F);
digitalWrite(strobe, HIGH);

delay (200);

digitalWrite(strobe, LOW);
shiftOut(data, clock, LSBFIRST, 0xc9); // 5th LED
shiftOut(data, clock, LSBFIRST, 0x01);
digitalWrite(strobe, HIGH);

delay (200);

digitalWrite(strobe, LOW);
shiftOut(data, clock, LSBFIRST, 0xc2); // 2nd segment 0xc2 address is 2nd segment 0x3F displaying 0
shiftOut(data, clock, LSBFIRST, 0x3F);
digitalWrite(strobe, HIGH);

delay (200);

digitalWrite(strobe, LOW);
shiftOut(data, clock, LSBFIRST, 0xc7); // 4th LED OFF
shiftOut(data, clock, LSBFIRST, 0x01);
digitalWrite(strobe, HIGH);

delay (200);

digitalWrite(strobe, LOW);
shiftOut(data, clock, LSBFIRST, 0xc4); // 3rd segment 0xc4 address is 3rd segment 0x3F displaying 0
shiftOut(data, clock, LSBFIRST, 0x3F);
digitalWrite(strobe, HIGH);

delay (200);

digitalWrite(strobe, LOW);
shiftOut(data, clock, LSBFIRST, 0xc5); // 3rd LED on
shiftOut(data, clock, LSBFIRST, 0x01);
digitalWrite(strobe, HIGH);

delay (300);

digitalWrite(strobe, LOW);
shiftOut(data, clock, LSBFIRST, 0xc3); // 2nd LED
shiftOut(data, clock, LSBFIRST, 0x01);
digitalWrite(strobe, HIGH);

delay (200);

digitalWrite(strobe, LOW);
shiftOut(data, clock, LSBFIRST, 0xc6); // 4thsegment 0xc6 address is 4th segment 0x3F displaying 0 4th
shiftOut(data, clock, LSBFIRST, 0x3F);
digitalWrite(strobe, HIGH);

delay (200);

digitalWrite(strobe, LOW);
shiftOut(data, clock, LSBFIRST, 0xc1); // 1st LED
shiftOut(data, clock, LSBFIRST, 0x01);
digitalWrite(strobe, HIGH);

delay (200);

digitalWrite(strobe, LOW);
shiftOut(data, clock, LSBFIRST, 0xc8); // 1st segment 0xc8 address is 5th segment 0x3F displaying 0 5th
shiftOut(data, clock, LSBFIRST, 0x3F);
digitalWrite(strobe, HIGH);

delay (200);

}

if someone could help me I would be so thankful
thanks for your time

Mark

Hi, Welcome to the forum.

Please read the first post in any forum entitled how to use this forum. http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code. It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

If you google TM1638 You will find a library for the display that will make your code so much easier. Here;

https://github.com/rjbatista/tm1638-library

Thanks... Tom... :)