Wednesday, February 20, 2013

Linux & Arduino UNO Development


During my latest foray into Arduino development, it became obvious that many of the things I want to do are easier to do in the Linux environment.  This is due to the fact that many Arduino developers are Mac users.  MacOS is based on Linux. 

Professionally, I program in Windows exclusively.  So, up until recently, I have stuck with programming my Arduino sketch editor, compilter and uploader in Windows.  Having said that, I used Unix throughout my undergrad years and early in my professional career.  Even after moving to Windows, I have attempted to use Linux several times over the years.  Unfortunately, each of my earlier attempts with Linux was abandoned for some reason or another. 

For my most recent attempt, I have installed Ubuntu 12.10.  The install on my Acer One (Windows 7 64-bit) laptop went smoothly.  Ubuntu installation is easy and straight-forward.  I opted for a 10G partition for Ubuntu.  After that, it was a matter of searching the web for a handful of Linux tools for a text editor as well as the Linux Arduino software development kit (SDK).  I am still re-learning my Unix/Linux shell control and command.   But, so far, I am pretty happy with Ubuntu and being reminded of how much fun it is to write simple but powerful scripts that can be run from the terminal window.

Frankly, I am not certain I would have been able to figure out how to get the Arduino UNO USB keyboard firmware up-and-running without  moving to Linux.  So, if you are interested in doing this, I recommend you make the move to Linux too.



Sunday, February 17, 2013

Arduino UNO as USB Keyboard "Emulator" : Motivation

Earlier this year, I built a nice gaming PC.  (More about this in a later post.)

While playing my current favorite FPS, I had the thought that it would be really cool if I had a customizable keyboard/controller.

Any experienced gamer can tell you, there are a handful of keystroke sequences that you use over and over again.  Some are pretty simple, like fire (L-mouse) then reload (R).  Others are more complicated.  One example is during stealth sniping in Crysis or Crysis 2.  In both of these games you often need to uncloak, fire, re-cloak.  If you fire while cloaked, your cloaking energy is rapidly depleted.  The faster you fire, the faster it is depleted.  So, one strategy is to first uncloak then start firing.  Then to ensure you remain undetected, immediately re-cloak as a defensive measure while seeking a new attack position.  The complexity of this maneuver has been reduced in Crysis 2. But, this idea of an Arduino UNO -based mouse + keyboard "macro" came to mind while I was playing Crysis. 

Having that said, I know there are some excellent gaming keyboards and controller systems commercially available.  So, if so motivated, I can buy one, but I found this idea so compelling that I finally had something new to explore with my old Arduino UNO.

Wow! It's been a while...

It has been over year since my last post.  What can I say?  I've been busy and frankly, I got a little too ambitious with my Arduino software plans.  My ambitious ideas led to a lot of "mental intertia" leading to a sense of foreboding preventing me from continuing any more work on the UNO-controlled cell phone project.

So, I have pretty much given up on my overly ambitious UNO project.  Instead, I have spent my time on less time-consuming, simpler experiments and home projects.  I will spend some time over the next few weeks describing these here.

For instance, I have recently built a decent mid-end gaming PC.  It took about two weeks from initial spec to final build and test.  I'll describe some of my inspiration and thinking as I was doing this and share some thoughts on what I might have done differently.

Over the past year I have built a couple of LED lighting projects that I would like to share.  There is also a bit of DIY home-improvement I will share.

Finally, over the past week or two, I have dusted off the Arduino UNO and played around with programming it to behave as a USB keyboard device.  Despite the lack of respect for chronological coherence, that is where I plan to start.