Help me achieving this effect through pinout

Better written as

const int chCount = sizeof(nanoPin) / sizeof(nanoPin[0]);

Need to initialize op. There is no guarantee is will be zero to begin with

for (int op=0; op < chCount; op++) {

You are going out of bounds. You access array elements from 0..chCount-1
You do this multiple places...