coding using Arduino, two 74HC595 and two RGB LED, problems with shifting out database
I suspect this is not the entire code.


You can't use delay as a variable name, it's (essentially) a reserved word in Arduino (it's a pre-defined function actually), and anyway you don't use that variable for anything.
You need brackets in your include (i.e. #include &lt;arduino.h&gt;)
You have a code block (the innermost set of enclosing in braces { ... }) for no apparent reason


UPDATE:


You probably shouldn't have a semicolon after for( i = index +1; i &lt; numberlamps  ; i++), and you should probably have curly braces around the subsequent lines of code.
The line display_step = 1 + display_step%numbersteps; should probably read display_step = (1 + display_step)%numbersteps;
You read information into the time variable, but then you don't do anything with that information.
A very effective way to diagnose problems with Arduino code like this is to use the Serial Monitor to periodically output relevant variable values as your program executes, using Serial.println(var_name) statements.


The problem is really that your code doesn't make sense and has no comments that express what you think it does... how about you start by drawing and sharing a flow diagram?