Example Code

Lego MindStorm NXT with Iphone control and On board Camera

Code and Documents

Attachment

This application allows you to control a Lego mindstorm via bluetooth and even see what it is seeing if you connect a wireless Ip camera to it. 

Front Pannel.PNG

The front pannel shows the Iphones sensor input and the the two motor drives outputs.  The data is streamed from your iphone via a data streaming app, this is then read in Via a UDP read and then processed to give control over the MindStorm NXT.  The program architecture is producer consumer with a queue to pass the data.  There is a third loop that reads the data from the ip camera this give a cool twist as you can then drive the MindStorm NXT around without needing to see it. 

Block Diagram.png

To use the program

Simply install a sensor data streaming app onto you Iphone, the app used here was "Sensor Data".  Then configure the front pannel to to you NXT's name and conection type,  if you have a wireless ip camera set this up and select this device on the front pannel.  Make sure you data streaming app is runn before you hit run,  then select the run this vision LED so it is green to enable vision and then enjoy playing.

Files are attatched and are In LabVIEW 2010

You will need the NXT tool kit installed and Vision to run the VI's

Matt Surridge

National Instruments

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors