'''
Read and write data to a Lego Mindstorm NXT brick using serial bluetooth
connection.  You'll need to modify __init__ for unix style serial port 
identification in order to use this on Linux.

Blue enables raw byte transfer
TypeBlue utilizes NXT mailbox number for type identification.

Usage:
1. Enable a bluetooth serial port to accept connection requests from NXT.
2. Find and connect computer from NXT bluetooth menu.  Note serial port
   number; store in comport_num.

3. From python try this code, note the try finally and make sure the connection
   is established so that you are not waiting all the time for timeouts!  It is
   a real pain getting the comport back from a dropped connection.
   
import blueNXT