programming keyboard for loop switching

Hi all

Is it possible to use the PC keyboard to switch between loops, for example when the W key is pressed loop1 begins and when X is pressed loop2 begins, if so does anybody have any pointers or any guidelines on this

Thanks

You need an application on the PC that can send keystrokes out the serial port. Serial monitor of the IDE can do that. Then you need a function to read the serial input sent to the Arduino, receive and parse the serial data and select which part of the sketch to run. Here is a great thread on how to receive and process serial data:serial input basics.. Then use if statements or switch case to select the function to execute.