Malcom,
Here is something you might be able to try. Add as the first data item in each pattern the number of items in the sequence (I counted quick, so there might be a mistake in the values I added)
Then use the something like the following to get the actual data:Code:patt1 data 17,16,1,2,4,8,16,32,64,128,128,64,32,16,8,4,2,1 patt2 data 9,8,129,66,36,24,24,36,66,129 patt3 data 17,16,1,3,2,6,4,12,8,24,16,48,32,96,64,192,128,0 patt4 data 17,16,1,128,2,64,4,32,8,16,8,32,4,64,2,128,1,0 patt5 data 13,12,24,60,126,255,231,195,129,0,129,195,231,255 patt6 data 14,13,1,2,4,8,17,34,68,136,16,32,64,128,0 patt7 data 9,8,128,64,32,16,8,4,2,1
This should allow you to sequence through each step for the various patterns, regardless of size. You could then loop back and start the FOR..NEXT loop again if required. Or, move on to some other code, or a different pattern. Also, inside the FOR..NEXT loop you could insert any code you needed. Test for various conditions, and even break out of the loop if needed to move on.Code:steps VAR BYTE counts VAR BYTE temp VAR BYTE READ Patt1, steps FOR counts = 1 TO steps READ (Patt1 + counts), temp PORTB = temp NEXT counts
NOTE: I have not tested the actual code, as it is ment to be just quick example to get across my idea, So don't cut and paste it. Try to understand the CONCEPT presented.
Regards,
Steve
Bookmarks