Recent Posts
Hacking a servo to perform full rotations
Servos are small motors that can rotate 180 degrees and whose position can be controlled. Some types of Servos can also rotate continuously. However, normal servos can be hacked to rotate 360 degrees. They are built with a small DC motor, a potentiometer and some control circuitry. The rotation of the motor changes the position of the potentiometer which acts as feedback for the control board to know the exact position of the servo.
read more
How to add Reveal to your RubyMotion app without modifying the Rakefile
TL;DR; Add this lines to a file named debugger_cmds in the root of your RubyMotion app. Then run your app with rake debug=1 to have Reveal automatically loaded.
breakpoint set -n UIApplicationMain breakpoint command add -s python -o 'lldb.debugger.HandleCommand("call (void*)dlopen(\"/Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/libReveal.dylib\", 0x2)");lldb.debugger.HandleCommand("continue")' Remember to add debugger_cmds to your gitignore file.
Long version Reveal is an awesome tool to debug and modify iOS views during development. However you usually have to modify your Rakefile to load it, and it might not please your coworkers if you accidentally commit the changes.
read more
Compiling MacRuby on OSX 10.9 Mavericks
Lately, I’ve been interested in programming language implementations in general, and LLVM in particular. You’ve probably heard of many projects based on LLVM like emscripten, rubinius, clang, rust or Rubymotion. Since I learn better by example, I wanted to have a large LLVM-based programming language codebase to experiment and tinker with. Given I’m already familiar with part of its codebase, Macruby seemed like the best option. Macruby is the predecessor of Rubymotion, and if you’re looking to build iOS or OSX apps, the latter is the best option for you.
read more