Linux and Arduino

Hello everyone! I'm thinking about a small project and I going need some guidance before start to build everything... I'm a Linux user and usually I use one workspace for fun and another one to work. I want to blink a LED, for example, every time I switch between these two workspaces. Someone know what I need to look for?

What do you mean by "workspace" - two different PCs?
How will the Arduino connect to two different PCs?

This demo shows how to talk to an Arduino with Python. You could probably simplify this and call the Python program with a bash script.


A workspace is like a virtual desktop. Windows doesn't support workspaces natively so it's a foreign concept to most computer users.

Some desktop environments (DE) might have a method to run a user-defined command whenever you switch to a different workspace, but you'll have to read the manual for your particular DE. If yours lets you run a custom command, you can write a simple script to open the Arduino's serial device and send a command to it. On the Arduino you'll need a simple program that blinks an LED (or whatever you want it to do) when it receives a command over the serial port.

If I were going to try that I would try a Python program with the PyGTK (I think thats the Gnome lib), assuming you are running a distro that is using Gnome for GUI. Probably something in there to detect which workspace, console, etc is active.

Easiest communication with Arduino is serial. Could use wired or wireless LAN also. Or other coms.