This example was realized using the AVIL shell sketch and uncommenting the the directive #define ETH_IO in compopt.h (see Configurations).
The purpose of this example is to show how to remotely control Arduino's digital I/O from your PC (linux or windows using cgwin ).
As second step connect a button on pin 6 and a led on pin 7 (like this ... just pay attention at the pins number!)
If you doesn't have led you can use as output the pin 13, to use the Arduino's onboard led.
The script define some functions to easily handle Arduino's digital I/O from a bash script (you can reuse the in your scripts!)
These functions sends the commands you can manually insert via telnet using netcat
Using these functions becomes easy to write an infinite loop that manage the digital I/O of a remote Arduino running the AVIL shell sketch:
Finally we can run our script from a terminal:
In this example we just print some output and turn on a led when a digital input is high, but obiouvsly you can modify the script to perfom more complex tasks on your PC depending on digital signals from the "real world"!