Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Play sound file with FRC Control system? (http://www.chiefdelphi.com/forums/showthread.php?t=93552)

CNettles11 13-03-2011 19:37

Play sound file with FRC Control system?
 
Hi, i know this sounds crazy but, is there any way you could program a sound file into teleop and have it playback through the FRC Control system? this might not be legal but our team is taking our bot around to elementary and middle schools and we want them to hear more than "WHIRRRRRRRR" come from our bot.

Thanks in advance
Chris Nettles
Team 3556, GET SMART

EHaskins 13-03-2011 22:08

Re: Play sound file with FRC Control system?
 
Probably not directly, but using an external device could work.

A quick search on SparkFun, and you can find several serial controlable MP3 player/decoder boards for <$50.
http://www.sparkfun.com/search/resul...&what=products

CNettles11 13-03-2011 22:14

Re: Play sound file with FRC Control system?
 
and would these have a way of pulling information from the cRIO or would a different communications/control confuguration have to take place alongside our robot radio?

rath358 13-03-2011 23:06

Re: Play sound file with FRC Control system?
 
It should be possible, but could be a major PITA. Last May, I made a programmable milling play the song from portal, using labview to write gcode to drive one of the motors at varying speeds. If one of your motors seems to have a different pitch at different speeds, you might be able to use that to get the desired result. pm me if you want to see the code.

EHaskins 13-03-2011 23:16

Re: Play sound file with FRC Control system?
 
Quote:

Originally Posted by CNettles11 (Post 1038903)
and would these have a way of pulling information from the cRIO or would a different communications/control confuguration have to take place alongside our robot radio?

The audio would be stored on an SD card attached to another device, controlled by the cRio via GPIOs or serial.

From the MP3 Trigger v2 page:
Description: Created in collaboration with Jamie Robertson, the MP3 Trigger is quite possibly the most versatile, low-cost, low power embedded MP3 Player. The board has 18 external trigger pins that will directly trigger pre-selected MP3 tracks, and a full-duplex serial control port that provides full transport control, remote triggering for up to 256 tracks, and fast real-time volume control. The board plays the MP3 files directly from a FAT16 microSD flash card and supports 192Kbps stereo playback. There is also an on-board navigation switch for local access and playback of all MP3 tracks on the flash card.

Datasheet

NOTE: I have not used this or any similar devices, but it looks like it should work.

CNettles11 14-03-2011 00:57

Re: Play sound file with FRC Control system?
 
Quote:

Originally Posted by EHaskins (Post 1038970)
The audio would be stored on an SD card attached to another device, controlled by the cRio via GPIOs or serial.

From the MP3 Trigger v2 page:
Description: Created in collaboration with Jamie Robertson, the MP3 Trigger is quite possibly the most versatile, low-cost, low power embedded MP3 Player. The board has 18 external trigger pins that will directly trigger pre-selected MP3 tracks, and a full-duplex serial control port that provides full transport control, remote triggering for up to 256 tracks, and fast real-time volume control. The board plays the MP3 files directly from a FAT16 microSD flash card and supports 192Kbps stereo playback. There is also an on-board navigation switch for local access and playback of all MP3 tracks on the flash card.

Datasheet

NOTE: I have not used this or any similar devices, but it looks like it should work.

This device looks like the solution, now how to control it through the DSC :confused:

EHaskins 14-03-2011 01:19

Re: Play sound file with FRC Control system?
 
Quote:

Originally Posted by CNettles11 (Post 1039060)
This device looks like the solution, now how to control it through the DSC :confused:

The simplest way would be to connect a digital output to one of the trigger pins on the MP3 Trigger device. Setting the digital output to low will cause a corosponding mp3 file to be played. This method can be used to control upto 18 files.

This is documented on page 3 of the datasheet I linked to above.

If you require more control you can also control it via serial, also documented in the datasheet.

CNettles11 14-03-2011 01:28

Re: Play sound file with FRC Control system?
 
Quote:

Originally Posted by EHaskins (Post 1039074)
The simplest way would be to connect a digital output to one of the trigger pins on the MP3 Trigger device. Setting the digital output to low will cause a corosponding mp3 file to be played. This method can be used to control upto 18 files.

This is documented on page 3 of the datasheet I linked to above.

If you require more control you can also control it via serial, also documented in the datasheet.

a couple more questions,
1) can you control digital ouputs from the drivers station?
2)Which DIO wires would run to the trigger?

EHaskins 14-03-2011 01:49

Re: Play sound file with FRC Control system?
 
Quote:

Originally Posted by CNettles11 (Post 1039085)
a couple more questions,
1) can you control digital ouputs from the drivers station?
2)Which DIO wires would run to the trigger?

1) You can. In Java, C++ is very similar. You'll need to find someone else to help if you're using LabView.
Code:

DigitalOutput file0 = new DigitalOutput(1);
Joystick stick = new Joystick(1);
//...

public void teleopPeriodic() {
        //...
        if (stick.getRawButtons(1)){
                file0.set(false);
        }
        else{
                file0.set(true);
        }
        //...
}
}

2) You would connect the signal wire, white, to the pin on the MP3 Trigger device.

CNettles11 14-03-2011 07:51

Re: Play sound file with FRC Control system?
 
well, i can dissect what i would need to do in labview from the java code you posted, Thanks!


All times are GMT -5. The time now is 09:31.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi