unsigned limits[32] = { 0, 1, 2, 4, 16, 64, 128, 64, 16, 4, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; void setup( void ) { Serial.begin( 9600 ); } char h[] = "0123456789ABCDEF"; char hex( unsigned val ) { return h[ val & 0b1111 ]; } void move( unsigned where ) { Serial.println( "" ); for( unsigned x = 0; x < 16; x++ ) { if( where + x < 16 ) { Serial.print( '0' ); Serial.print( hex( where + x ) ); } else { Serial.print( '1' ); Serial.print( hex( where - 16 + x ) ); } Serial.print( hex( limits[x] >> 4 ) ); Serial.println( hex( limits[x] ) ); } delay( 50 ); } void loop( void ) { for( unsigned a = 0; a < 21; a++ ) move( a ); for( unsigned a = 21; a > 0; a-- ) move( a ); }