A simple sketch to do I/O from commands on Arduino

I know you said you're proud of that piece of code, but I have a few concerns....

First off, I would avoid recursion on an embedded processor like the AVR as much as possible. With a limited stack and memory size, recursion can very quickly become a problem. This gets made even worse if you do recursion as a result of user input. Whenever a program takes external inputs, there is a risk of abuse. In this case, just passing a lot of spacces as an argument to a function would blow the stack.

Secondly, recursion is really not useful in this case. It looks to me like you're trying to skip past whitespace. I would just make a function that does just that using a loop, not recursion. Recursion is useful when a state is maintained and data has to be passed back (B-Tree searches, fibunachi sequences, etc.). Just to skip something, a simple while loop would do.

Maybe something like this would do:

int isArg()
{
    char c = Serial.peek();

    while (c == ' ' || c = '\t')
    {
        getch();
        c = Serial.peek();
    }

    return isDigit(c) ? 1 : 0;
}