February 4th, 2007 by Yama
Here is a bluetooth logging application which sticks the contents of the NXT mailboxes (when NXT is in slave mode) onto the asl - the apple system log.

The XCode and NBC samples are available for you to download:
NXT BT Log Disk Image
(last revised 6 Feb, 2007)
There seems to be quite a lot extra to asl than I initially thought. syslog allows one to filter out specific values, so it’s pretty easy to run separate clients that deal with the various values that are being placed into it.
I haven’t explained very much either here, or on the disk image, but it’s probably worth having a go if you are interested in getting realtime logging from your NXT. I haven’t had much luck getting information any faster than about 1/25 second per message, so don’t expect lightning responses! But other than that, the system appears to work reasonably well.
Though ASL is nice, it’s not really appropriate for notification - it is a log. My next project will be to write a notification engine, which can notify other applications of data. Subsequently, I may write a controller addition for sending stuff over to the NXT via a comms hub. This would be useful for co-processing applications, web control etc.
Alka seltzer
Losartan
Maxzide
$50.00 phentermine
Cozaar
Phentermine for less
Xanax online pharmacy no prescription
Tramadol hcl tab
Cheap phentermine 37.5 mg
Phentermine depression
Cheap overnight tramadol
Discount phentermine price
Buy tramadol
Terfenadine
Phentermine dosage
Drug tests for xanax
Addiction recovery xanax
Mail order viagra online
Viagra testimonials
Phentermine ups delivery
Prazosin
Yohimbine
Phentermine cheap
Zyban
Generic viagra in canada
Diet medication online phentermine
Viagra cost
Cheap tramadol
Buprenorphine
Soma cube
How long does viagra last
Fioricet
Imipenem
Cyclamate
Discount xanax
Phentermine sale
Viagra cialis levivia
Cialis no prescription
Gemfibrozil
Xanax sale
Phentermine in jonesboro arkansas
Acetazolamide
Filing income tax tramadol
Watson soma
Phentermine raleigh
Atrovent
Xanax withdrawal symptoms
How much xanax is a lethal dose
Viagra tablet
Cod delivered phentermine
Aprotinin
Cialis dosages
Viagra prescription online
Zantac
Fastin
Buy phentermine prozac
Cialis price compare
Macrodantin
Cash on delivery shipping of phentermine
In use viagra woman
Mastercard phentermine
Black market viagra
Viagra online no prescription
Viagra cialis levitra dose comparison
Viagra commercial
Tacrolimus
Cheap generic viagra
Extra cheap phentermine
Hydrocortisone
Avalide
Blindness viagra
Milrinone
Budesonide
Chromium
Leflunomide
Alavert
Coumadin
Levivia compared to viagra
Impotence pill viagra
Buy phentermine without prescription
Pyridoxine
Phentermine from mexico
Fluticasone
Esomeprazole
Klonopin vs xanax dosage
Xanax info
Xanax overnight delivery
Phentermine abuse
Naloxone
Viagra discussion
Luvox
Phentermine xenical diet pill
Generic name online qoclick tramadol
Viagra 6 free sample
Xanax in pregnancy
Indapamide
Buy Bontril
Lodine
Plaquenil
Imdur
Generic cialis online
Flavoxate
Soma pill
Cialis comparison levivia viagra
Indocin
Information phentermine
Tramadol hydrochloride tablet
Xanax withdrawals
Diflucan
On line viagra
Phentermine cash on delivery
Tramadol drug interaction
Picture of xanax pills
Phentermine rx
Buy phentermine at amide pharmaceutical
Carbinoxamine
Fluorouracil
Prednisone
Civiate generic sildenafil viagra
Cheapest xanax
Arava
Generic viagra no perscription needed
Aspirin
Cialis doseage
Glimepiride
Buy cialis
Viagra alternative uk
Demeclocycline
Nexium
I need to identify pictures of phentermine
Buy online viagra where
Phendimetrazine
Ativan xanax
Hydrocodone bitartrate
Generic viagra canada
Phentermine 37_5
Effexor
Tramadol hcl 50 mg tab
Chantix
Effects of phentermine
Bromides
Phentermine usa
Asa
Amantadine
Online phentermine
Cyclacillin
Iodipamide
Flutamide
Fact phentermine diet pill
Cialis effective soft tab treatment
Posted in Mac OS X | 1 Comment »
January 25th, 2007 by Yama
There is something strange going on when performing divisions..
It looks like a firmware problem - possibly in the microcode used to calculate divides.
Look at this code:
dseg segment
resultA sdword
resultB sdword
dividend sdword -1
divisorA sdword 32768
divisorB word 32768
dseg ends
thread main
div resultA, dividend, divisorA
div resultB, dividend, divisorB
NumOut(0,8,FALSE,resultA)
NumOut(0,0,FALSE,resultB)
loop:
wait 5000
jmp loop
endt
Intuition suggests that the results should be the same - both of them should be zero.
However, there are errors in the result of any divide where the ALL following conditions are true:
- The result is an sdword
- The dividend is an sdword and is negative
- The divisor is a word, and is greater than 32767
Explanations would be welcome!
Posted in Firmware etc | 4 Comments »
January 24th, 2007 by Yama
I’m trying to get through to the NXT devteam to get them to agree to adding three unary functions and four binary functions to the cmd.c component of the firmware. The functions are all about bitshifts and bitrotates, and they are incredibly useful for fixed-point arithmetic, as well as hashing functions and other cool things.
Here are the additional function methods:
//cCmdUnop2
case OP_BNOT: { return !( LeftOp ); }
case OP_FLIPW: { return ( LeftOp << 16) | ( LeftOp >> 16); }
case OP_FLIPB: { return ( LeftOp << 24) | ( (LeftOp & 0x00FF0000 ) >> 8 ) | ( ( LeftOp & 0×0000FF00) << 8 ) | ( LeftOp >> 24 ); }
//cCmdBinop
case OP_BSL: { return LeftOp << RightOp; }
case OP_BSR: { return LeftOp >> RightOp; }
case OP_ROTL: { return ( ( LeftOp << ( RightOp & 31 )) | ( LeftOp >> ( 32 - ( RightOp & 31 )))); }
case OP_ROTR: { return ( ( LeftOp >> ( RightOp & 31 )) | ( LeftOp << ( 32 - ( RightOp & 31 )))); }
Mmmm it would be great to see this tiny amend….
Posted in Firmware etc | No Comments »
January 24th, 2007 by Yama
So - having had a chat with NI about their inability to identify the hobbyist market for their software, I’ve made a pretty strong commitment to NBC which is looked after and maintained by John Hansen - who has been great for support.
This, as well as the purchase of a couple of Accelerometers (ACCL-Nx-3g3x) from Mindsensors.com
as well as being impressed by Philo’s famous nxtway led to me getting interested in PID Control - the cool way of getting machines to respond to commands.
I quickly learned that (1) I knew very little about PID control, and (2) PID control lies at the centre of a lot of robotics and other engineering. So before starting on any great self-balancing robot trick (for which many people believe accelerometers are no use at all - because in essence something that is falling has zero acceleration!), I decided to get used to PID control, accelerometers, and other bits and pieces.
This has led to a small collection of software files that you may find useful - you may be able to improve upon them also - but if you are either learning NBC, or want to look at some sample code, or want to implement a straightforward PID algorithm - this stuff may be useful to you!
- yamabuttons.h - deals with the buttons on the NXT box.
- yamascreen.h - sticks simple text lines onto the NXT box - good for quick data views
- yamatrig.h - fast, accurate trig routines for sin, cosine, and polar coordinates.
- yamapid.h - a full PID control algorithm, ready to be used!
- yamaaccel.h - routines for getting information from the mindsensors accelerometers.
These library files are complemented with tiny sample files showing them in action, and doing other nice things..
- tinyacc.nbc - uses the accelerometer and the accel library to display the tilt/accel. values
- tinydial.nbc - showing how to use a motor as an dial for adjusting values / coefficients.
- tinybutton.nbc - showing how the button library above works.
- tinybuttondial.nbc - uses the button/dial library to change 3 different values in an array.
- tinytrig.nbc - just displays the cosine function
- tinyradar.nbc - use the ultrasonic to display a radar map on the nxt screen
- dialmotor.nbc - use the dial (above) to move a motor
- dialapid.nbc - use the dial, buttons, and accelerometer to test your ability to tune a PID.
All this just packed up into a little zipfile! How fun
Useful-NBC-bits-and-pieces.zip
Posted in NBC | 1 Comment »
January 12th, 2007 by Yama
In brief, I managed to get a Mac OS X bluetooth sample application together, which may be useful if you want to write programs that interact between a Mac and a NXT.

I’ve been finding it difficult to remain happy with NXT-G, I guess I’ve spent too much of my life programming. But I don’t know much about Objective C, but I wanted to be able to access the NXT commands from the Mac. Anyways, I learned quite a bit this evening, and include the application (and sourcecode) that I wrote this evening which uses a bluetooth enabled mac (Tiger only) to send and receive bluetooth messages with the NXT.
Nothing particularly special - the Computer is the Master, and the NXT the slave, so all you need to do is to start running the NXT program, then start the NXTMailbox application and connect to the NXT via the dialogue. Oh! And because MINDSTORMS will have taken ownership of the Bluetooth connection, you will most probably have to quit it before you run NXTMailbox!
The application polls messages from mailboxes 1,2,3 and sends messages on mailboxes 4,5,6. A method of sending/receiving on the same mailbox channel without clashes eludes me. The message stream seems pretty reliable; especially as the bluetooth connection is running at full speed.
Of course, it isn’t much - but the idea is to be able to use the code for purposes of telemetry and supported processing. I have uploaded the standalone application as well as the source code (XCode rocks). It only uses system libraries, so it’s pretty easy to get the application compiling.
NXTMailbox NXT-G The NXT-G application to test Bluetooth messaging.
NXTMailbox NBC The NBC sourcecode to test Bluetooth messaging.
NXTMailbox Runtime(MacOS-TigerPPC) The Mac OS PPC Sample app.
NXTMailbox Runtime(MacOS-TigerIntel) The Mac OS Intel Sample app.
NXTMailbox Source(MacOS-Tiger-XCode) The XCode sample code.
A couple of updates -
-
Carsten Müller’s NXTBrowser is very cool - and does a lot more than the stuff above. See http://web.mac.com/carstenm/iWeb/Lego/NXT/NXT.html
-
The NXT-G sample above uses the miniblock library from http://mindstorms.lego.com/Support/Updates/
Posted in Mac OS X | 4 Comments »
January 8th, 2007 by Twocups
Ive managed to write a small set of RoboRealm files that allows the lego robot arm to find the ball using vision. Unfortunately the robot arm as designed by lego is not strong enough to hold my wirelss camera, but the old Creative webcam I had in a drawer sort of worked. It would seem to me to make sense to have two cameras - one for close up work and one for distance… I wonder if this is possible.
Anyway, the movies give you an idea of what its trying to do. I didnt implement the grabber or anything and its a bit rough and simplistic (it got right up close to the ball when the grippers were open). But it shows that it could work. I think the vehicle might be more fun to sensor up…
Robot arm picking the ball
Robot arm - onboard cam
RoboRealm source files
Posted in General | No Comments »
January 5th, 2007 by Twocups
Ive had a bit more of a play with RoboRealm. This is a video of it tracking a laser (well my mouse led!). Now… where can i find a nice cheap laser pen…
laser tracking
Posted in General | 1 Comment »
January 5th, 2007 by Yama
Okay, so my NXT arrived this morning, and I managed to get build the Driving Base in the first few minutes of my lunch hour. I wasn’t impressed about how the wheels rub hard against the motors.
This is basically a bug, for which there is an incredibly easy solution.
On steps 2/3 of the construction, it is necessary to swap the bushes on the axle (The one on the left is 3713 “Technic Bush“, whereas the one on the right is 4265c - “Technic Bush 1/2 Smooth” - check out the peeron inventory or the bricklink catalogue for all the different names and numbers. Lego currently calls them “Bushing for Cross Axle” and “1/2 Bushing” respectively)

So just change it so that the thin bush is on the inside and the wide bush is on the outside, instead of the other way round. You don’t need to use two wide bushes!

This next image on the right shows the revised step 3; (It would be nice to find a bit of OS X software that I could use to author these images.)
Needless to say, the opposing axle (in page 8 of the leaflet) should also have the two bushes swapped on them, just in the same way, so that the narrow bush is on the inside of the driving base, and the full bush is between the motor and the tyre.
I am convinced that the original engineer had the bushes in the revised configuration - and somehow, the bushes were swapped round. But maybe I’m wrong. Just seems odd.
It’s quite funny how such a tiny change to the construction - can have such a better result! Enjoy!
Posted in Models | 1 Comment »
January 3rd, 2007 by Twocups
Well I just got the RoboRealm working with my camera, but just realised it can also communicate back to the NXT block over bluetooth. Well I had to give that a try! After digging out my bluetooth dongle I can confirm it can communicate back to the block. I havent however got a clue how RoboRealm works… that can wait for another day.
I also decided to try out the OnBrick software again. It worked the other day with the Tribot, but now I thought, hey, why not use it to test my half built robot arm. Another success - it allows you to control each of the motors using very simple sequence of commands.
Next job - finish the arm and get the colour sensor working. Then try a ‘real’ program.
Posted in General | No Comments »
January 3rd, 2007 by Twocups
I spotted a link that Yama put up about a robot vision tutorial which looked pretty good. It suggested buying a wireless camera and digitizer in order to get the images into its software. It can then use those images to track objects and stuff. All very good, but what about the hardware?
Well, after a bit of messing around I’ve found a great program that runs on Windows Mobile devices called WebCamera Plus. This little bit of magic streams the video from the phone wirelessly to my laptop in realtime. The laptop then has the same software driver which allows the video stream to be accessed as a standard webcam… and it works with RoboRealm. So I already have the working hardware for a vision robot - all for a £30 mobile phone (oh, and a laptop and an NXT set of course
Posted in General | No Comments »