what is permitted in a switch case?

Is it OK to run functions and for () functions inside various cases of a switch structure ?

These functions redtens (); zero(); and one(); all run OK on their own, but the code just doesn't run the switch statement.... heres a bit of the code:-

      case 2:
        ////////////////////////////////////   send all this 4 times with pilot and sync bit
        for ( int n =0; n>=3; n++ ){
          redtens ();  //  sends tile and customer number for red tens
          digitalWrite(dataPin, LOW );

      case 3:

This code actually compiles ??? Where is the closing brace for your "for" loop. Maybe you should post the entire routine.

This is wrong:

for ( int n =0; n>=3; n++ ){

Initializing n to 0 will cause the for-loop conditional n >= 3 to always fail and your loop will never be executed.

You probably meant:

for ( int n =0; n<=3; n++ ){

LOL - I really can't believe I did that !! :blush:

Thanks a lot

Glad to help. Cheers.

You wont believe how many times I overlooked that while going through for == etc !

It now works of course.... what a great forum !