BlitzMax & Lego Mindstorms NXT

BlitzMax Forums/BlitzMax Programming/BlitzMax & Lego Mindstorms NXT

I just discovered that we can forget the whole serial port programming thing!!

The info was here:
http://juju.org/articles/2006/08/01/mindstorms-nxt-bluetooth-on-osx

All I need to do on the console to properly initalize the bluetooth port is this:

cat /dev/tty.NXT_1

The important part is -not- to close the terminal window or abort the command with ctrl-c. It needs to stay open for as long as the connection to the brick is required.

After "opening" the port with the cat command, I can simply send commands from BlitzMax through a stream, and the brick receives and accepts them.

The challenge now is to get BlitzMax to do all of that. The dirty approach would be to launch a background process that performs the cat command, and then proceed with the BlitzMax code. Not beautiful, but it'd probably work.