NI Home > Community > NI Discussion Forums

LabVIEW for LEGO MINDSTORMS and LabVIEW for Education

Showing results for 
Search instead for 
Do you mean 
Reply
Member
tbag
Posts: 16
0 Kudos

Can I Bluetooth sensor data from the NXT to labview on my computer, process the data, then either respond with the appropriate musical response through my computer speakers or Bluetooth to another speaker device?

Hi,

 

I am using the NXT as a simple means to get data from sensors ( microphone, accelerometer and gyroscope) and then respond to their different sensor outputs with certain musical sounds. I have come to find that the NXT is limited in its sound memory but most importantly in the sound quality. What I am now therefore looking into doing is to Bluetooth any sensor outputs to labview on my computer which will then do all the processing and output better quality music from its speakers, and if possible, take this further and have the computer Bluetooth the appropriate musical output to be played to separate high quality speakers.  Im essentially trying to by pass the low memory and especially poor sound quality of the NXT device. Is this possible? If it is, how would I go about implementing it? Any help would be very much appreciated : ) .

Many thanks 

Member
Oli.P
Posts: 122
0 Kudos

Re: Can I Bluetooth sensor data from the NXT to labview on my computer, process the data, then either respond with the appropriate musical response through my computer speakers or Bluetooth to another speaker device?

Hi tbag,

 

So sorry that you haven't got a reply sooner.  Your post must have slipped through the net!

 

Are you still looking for some help with your NXT and the bluetooth data transfer?  You scenario certainly sounds achievable.  I don't know if you've come across this post, but that might be a good place to start.

 

Best Regards, 

Oli
LabVIEW Student Ambassador
National Instruments UK
Member
tbag
Posts: 16
0 Kudos

Re: Can I Bluetooth sensor data from the NXT to labview on my computer, process the data, then either respond with the appropriate musical response through my computer speakers or Bluetooth to another speaker device?

Hi, its ok, I think ive sorted out a way to do it. Although i do have another question. I would like to program the lego touch sensor so that while the button is pressed and held in a musical sample is played until the button is released then music stops ( straight away - it doesnt wait until sample finishes, it just stops dead). Then if i pressed and held down button again it will play a different sample until button is released where again sample stops playing straight away. Then again different sample played when rpessed third time, but on fourth time it starts again as if it was infact being pressed for the first time.

 

iVe attached 3 images to show you what ive tried to do so far. What ive acheived is a program which counts the number of times a button is pressed within a time period and depending on that number of times plays a sample of music ive assigned. This is almost what I want but not exactly as it doesnt play the sample right away and continue playing as button is held down until released where sample stops playing as ive explained previously. Hope you can help.

 

Many thanks

 

Tim

(image 1 shows outmost layer of vi; image 2 is via for counter;image 3 is vi for playing sound file) 

Member
Oli.P
Posts: 122
0 Kudos

Re: Can I Bluetooth sensor data from the NXT to labview on my computer, process the data, then either respond with the appropriate musical response through my computer speakers or Bluetooth to another speaker device?

Hi Tim,

 

I must have not got an email update from this forum when you posted last week.  I will have to look into that.

 

To enable you to stop the sound file, I would suggest that you create a parallel while loop in your top VI that continuously polls the button press function to.  You could double up your code slightly so that the code to poll the button is in the same sequence frame as the case structure for choosing your sound.

 

Then you can add a check inside the while loop in the sound play VI to see if the button is still pressed each time.  If you then force the close reference on the sound file, that should stop the sound.  It looks like you have a Sound Output Wait VI, try removing that so that your code doesn't wait for the sound to finish.  Then the sound reference will be cleared and that will stop the playback.

 

If you open up Context Help (ctrl-h) you can see information about what each of the VIs do.

 

I hope that helps.  Sorry for the late reply.

Oli
LabVIEW Student Ambassador
National Instruments UK