ruby-nxt 6
I made a lot of progress this weekend on ruby-nxt. I got most of the Direct Commands completed. Update: ruby-nxt can now be found at rubyforge.
It makes programming the NXT as simple as:
require 'nxt.rb'
NXT.exec("/dev/tty.NXT-B") do |cmd|
puts "Battery Level: #{cmd.GetBatteryLevel[0]/1000.0} V"
cmd.PlaySoundFile(true,"Good Job.rso")
sleep(3)
cmd.StopSoundPlayback
endOnce I get it a little more polished, I plan on also creating a Ruby On Rails plugin. Forget Microsoft Robotics Studio. ;)
Trackbacks
Use the following link to trackback from your own site:
http://www.juju.org/articles/trackback/410
Juju
Tony, this is seriously nice. I am going to have to try this out on my linux box at some point when I have the tuits.
Until then, I have blogged this at orionrobots: http://orionrobots.co.uk/tiki-viewblogpost.php?blogId=1&postId=113
Unfortunately, I have not got trackback pings coming out of my CMS at the moment, but rest assured I have linked to you from there.
Have you thought about how this, and the phone AT command menu setups, could be used together? Having a ruby script to setup a series of commands, try them out, then send them to a mobile to attach to a button?
Danny
Hi and thanks. If only there was a ruby interpreter that ran on a cell phone. :) If you use ruby-nxt and set $DEBUG = true, it will print out the bytes that it's sending and recieving so it could be used to figure out what commands need to be sent to do what you want.
As for getting it working in linux, check out this page for how to pair the NXT. I haven't tested it yet, but I will when I get a chance. If you get it working let me know. Also, the ruby-serialport module says it works in windows also. Instead of passing a "/dev/ttyS0", you'd pass it "COMx" where x is the port number.
You had asked about licensing on your blog, consider it GPL. :) I'll stick it in the comments when I get a chance.
Apparently it's not quite that easy on windows, you need a compiler. For more info check here. I probably won't be testing it on windows.
I got it working in windows under cygwin!
Check out someone created an nxt direct commands module for perl.
This is awesome. Exactly what I've been looking for. Please do keep working on this. I'm hooked up to your svn repository.