program

A Perl getopts example

Perl getopts FAQ: Can you demonstrate how to use the getopts function? (Also written as, "Can you demonstrate how to read Perl command line arguments?")

Ruby command line arguments

Ruby FAQ: How do I read command line arguments in a Ruby script (Ruby command line args)?

To read command line args in a Ruby script, use the special Ruby array ARGV to get the information you need. Here are a few examples.

1) Getting the number of command line args

To get the number of command line arguments passed in to your Ruby script, check ARGV.length, like this:

A simple Arduino Uno LED fade program

Shortly after writing my Arduino Uno Hello, World example, I read my documentation a little more, learned that Pin 9 on the Arduino Uno board is an analog pin, switched the LED wire to that pin, and created the following program, which slowly lights up the LED using an analog programming approach, and then fades the LED light out.

Here's the source code for my LED fade sketch:

An Arduino Uno Hello, World program

Last night I finally got some time to work with my new Arduino Uno board, and created a little "Hello, world" program. This program is just the same "LED on Pin 13" program I see repeated in every book and on every website, but it really is helpful when you're struggling to get started with the Arduino hardware, like I was.