One of the best advantages of having a shared runtine between Objective-C and Ruby in RubyMotion, is that it allows us to use the huge number of Ojective-C libraries available. One way to include them in our RubyMotion project is through CocoaPods, a dependency manager similar to RubyGems, but for Objective-C libraries. RubyMotion supports CocoaPods out-of-the-box, through the motion-cocoapods gem. Here you can learn how to use them. However, not every Objective-C library is supported by CocoaPods, but we can still use them. These are the basic steps:*Find an Objective-C library that fits your needs (probably on Github). Create a directory named “vendor” inside your project directory. Clone the repository of the library to a subdirectory in “vendor/”. You can[…]

Who likes cables? Nobody likes cables. They limit your range of action, they get tangled up and they are simply ugly. Thats why we invented wireless technologies, like bluetooth. So lets get our hands dirty. What you need for this simple demo is:*An Arduino (UNO, Mega, Duemilanove, etc.). A led. A bluetooth module (You can buy it on Dealextreme or just do a quick Ebay search) A USB Bluetooth dongle in case your computer doesn’t have built-in bluetooth. This one from Dealextreme is just fine for $1.80. Mac OS X or Linux. Once you have all of this we can start. First we have to wire the Bluetooth module and Arduino. Do it as shown in the picture: The Rx[…]

In a previous post I explained how to talk to Arduino through the serial port. Now taking advantage of this usb-to-serial interface we’re going to send instructions to Arduino using a USB Joystick. Any Playstation-like controller or Xbox 360 controller with a USB receiver will work. However if you’re on Mac you will need this drivers for the Xbox 360 controller. Since I used Ruby in the previous post, I wanted to use Ruby for getting the joystick input in order to write a cleaner script. I found Rubygame to be the best option. It’s a Ruby framework for game developers, inspired in Pygame (the same thing but written in Python) which is a wrapper of the SDL library. The[…]

I wanted to be able to pass any data to Arduino from my PC or the Internet. There are several ways to do that. The most obvious one is buying an Ethernet Shield or Bluetooth module, but they are more expensive than an actual Arduino Uno, so I looked for alternatives. I wanted to create a web interface to control Arduino, so these Serial-to-Network libraries seemed like the best solution to do it with PHP since it doesnt support serial connection (well actually there’s a PHPSerial class for doing that but it didn’t word for me under Mac OSx Lion). First I tried SerialIP since it didn’t need any additional software on the host. However the slattach command was removed in OSx 10.5.[…]