if (command == 7)
while (command != 6)
but even when i send the byte '7' to the Arduino, the first relay stays closed. This is confusing me thoroughly. The only thing i can think of is the Arduino isn't taking the second the second byte at all, it is too focused on the first one received. Any tips? I can post the full code if needed. Thanks so much.
Not surprising. If command == 7 it will always !=6 so you will be stuck in that while loop. The while loop needs command == 6 to exit. You don't need that loop at all.
It sounds like a switch statement might be a better idea.