Pass parameters on cmd line; getopt ?

I want to pass multiple parameters to my program from the command line. Something similar to getopt. Has anyone put a getopt function or something like it for Arduino?

RichK

Well, it's not exactly getopt(), but a similar approach: you might consider using Bitlash on the Arduino, and extending it with your own application-specific code.

Bitlash is an interpreted language shell that runs on the Arduino. It's available at http://bitlash.net as open source. There is a blog posting here that shows how to integrate your own C functions into Bitlash: http://www.entropymouse.com/blog/blog:bitlash_1.1_and_servo_mayhem

The bottom line is that it's easy to use Bitlash to do all the text parsing and expression handling, and pass the results to the code you add as a User Function. So you could add a function named foo(), and then call it from the serial monitor in the obvious way:

> foo(1,2,3)

Of course you can use the Bitlash expression interpreter as well:

> i=0; while i++<10: foo(i, i*i, D8); delay(100)

All for the price of learning to integrate a little foo :wink:

-br

http://entropymouse.com

I will check it out