Help with Subroutines

Hey - just have a quick question about subroutines.

How do I make a subroutine loop itself?


How do I make a subroutine loop itself?

Please explain what you want to do. There are many possible solutions.

I am prompting a user on an lcd screen to use a keypad to start a program. After pressing a key to start the program they will enter in their wage. The the wage is calculated in real time until they cancel out of the program.
Here is the code I have so far, thanks:

#include <SoftwareSerial.h>
#include <Keypad.h>

char N;
int I;
int ByteVar;

int NN;
int Remainder;
int Num_5;
#define ledpin 13
#define rxPin 11  // rxPin is immaterial - not used - just make this an unused Arduino pin number
#define txPin 14 // pin 14 is analog pin 0, on a BBB just use a servo cable :), see Reference pinMode
SoftwareSerial mySerial =  SoftwareSerial(rxPin, txPin);
const byte ROWS = 4; //four rows
const byte COLS = 3; //three columns
char keys[ROWS][COLS] = {
byte rowPins[ROWS] = {5, 4, 3, 2}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {8, 7, 6}; //connect to the column pinouts of the keypad

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
// mySerial is connected to the TX pin so mySerial.print commands are used
// one could just as well use the software mySerial library to communicate on another pin

void setup(){
   digitalWrite(ledpin, HIGH);

   pinMode(txPin, OUTPUT);
   mySerial.begin(9600);      // 9600 baud is chip comm speed

   mySerial.print("?G216");   // set display geometry,  2 x 16 characters in this case
   delay(500);                // pause to allow LCD EEPROM to program

   mySerial.print("?Bff");    // set backlight to ff hex, maximum brightness
   delay(1000);                // pause to allow LCD EEPROM to program

   mySerial.print("?s6");     // set tabs to six spaces
   delay(1000);               // pause to allow LCD EEPROM to program
    mySerial.print("?D00000000000000000");       // define special characters
   delay(300);                                  // delay to allow write to EEPROM
                                                // see for a handy custom char generator (software app)
   mySerial.print("?f");                   // clear the LCD
   mySerial.print("Opportunity Cost");


void loop(){

  char key = keypad.getKey();
  if(key)  // same as if(key != NO_KEY)
    switch (key)
      case '#': pop();       
      case '*':
        mySerial.print("    welcome     ");
        mySerial.print("                ");
    mySerial.print("Pres # to begin ");
    mySerial.print("                ");

void pop() {

   mySerial.print("Thankyou        ");
   mySerial.print("                ");
   while (keypad.getKey() == NO_KEY)
    mySerial.print("Enter your wage ");
    mySerial.print("                ");

Look up examples and such of a technique called "state machine".
The short version, it is a technique to distinguish between states, where actions can be taken inside a state, or to change the state.