You just print the prompt out. Then you use this (in your loop):
if(Serial.available()){ //Someone entered something in the serial display
byte c = Serial.read();
}
if(c > 0){ //We have a non-null value, so do something with it
switch(c){
case 'm': //'m' was sent
//run some code meant for 'm'
break; //always break after doing the command unless you want it to "fall through"
case 'n': //'n' was sent...
//do some code for 'n'
break;
//etc...
}
If you have multiple steps, like multiple prompts, keep a state machine (keep a count of steps) so it knows what step it is at.
In your case, it might make more sense to increment the steps based on the interrupt. That way your code knows when the button was actually pressed.
byte state = 0;
byte light_toggle;
byte fan_toggle;
#define maxStates 6 //if there will be six steps total
void loop(){
switch(state){
case 0:
Serial.print("Press the light toggle switch");
break:
case 1:
light_toggle = value;
Serial.print("Light toggle command is: ");
Serial.println(light_toggle, DEC);
state++ //we have to increment the state here since no interrupt
break;
case 2:
Serial.print("Press the fan toggle switch")
break;
case 4:
fan_toggle = value;
Serial.print("Fan toggle command is: ");
Serial.println(fan_toggle, DEC);
state++ //we have to increment the state here since no interrupt
break;
//etc... for all states
}
}
void interrupt(){
state = state++ //increments the state counter
//....do normal interrupt code here
if(state > maxStates) state = 0; //reset the state counter
}
If your value is 8 bits use byte value
in your declaration, if it will be 16, use unsinged int value