Problem calling a function from another function

I am at a loss and I must be doing something simple wrong. If we throw out the startAnimation function and just try to call the registerWrite function from the loop I still can't get it to work

This code still works:

for ( int bitToSet = 0; bitToSet <=8; bitToSet++) {
  registerWrite(bitToSet, HIGH);
  Serial/println(bitToSet);
  delay(1000);
}

If I try to call registerWrite outside of the for loop I imagine it should work the same. However it never triggers the relay that is attached.

registerWrite(5, High);
delay(1000);

If I write it and define an int first it still fails.

int z = 5;
registerWrite(5, High);
delay(1000);

Any thought on why that would be?

  • Josh