Hi, I'm using C# to send values to my arduino such as 12 and 24 to my arduino. I've got the coding were my arduino reads 12 if i send <12> from C# and when i send * an infinte for loop is activated. Now I got the infinite for loop to go from 0 to 15 and start again from 0 to 15 and this will keep on going until the arduino is switched on.

my infite for loop for (int b = 0; b<17; b++) { look what is the value of serialValue and do something}

I did this infinite for loop because i'm storing the C# values on the ardunio, which are then stored in an array called serialValues, and when i send * from C# the infinte loop starts.As explaind i want the arduino to go through all the values it received and if it receives 12 and pin 10 is high then pin 12 is high etc..

the problem i'm facing is that when the infite loop starts again from 0 and the value 12 reappeard from the array and pin 10 is low, pin 12 remains high and i want it to go LOW. And when b starts from 0 again and pin 10 is high i want pin12 u go high again

HERE is my coding I would appreciate any help cause i'm a college student and i need to solve this problme ASAP