Cortex Speaker

Has anyone attempted to use the Speaker port on the Cortex controller? If so what type of speaker are you using and are you able to play sounds from the sound library?
I am using RobotC. Currently I just have a normal 2-wire 8ohm speaker connected to the PWM 29-controller and into a motor port. I am able to produce sounds of different frequencies through that but I saw that RobotC has functions for playing sounds in their sound library. So I’m just curious as to how that works.

Thanks in advance for any assistance.

I’ve used it a bit, and it works pretty well. The speaker port on the Cortex is actually a DAC (Digital-to-analog convertor) so it provides a “cleaner” output to the speaker than the PWM motor output can. I wrote a little function that takes strings and plays them as tunes:


It handles sharps/flats, tempo, multiple octaves, etc. It isn’t going to win a Technical Grammy, but let me know if you want me to post it.

I wouldn’t connect an 8Ω speaker directly to the SP port, though, because it won’t be very loud (not enough current drive from the SP port) and there is some risk of damaging the port.

I used a simple LM386 amplifier that I made, and I’ve also used this amp successfully with the Cortex SP port. You’ll need a cable with a couple resistors in it to drop the signal down to a line-level audio signal (otherwise you have to be VERY careful never to turn the volume up above about 10%). I can post the details of the cable I made this evening if you are interested.


  • Dean

so is this legal for vex gateway?

Nope you aren’t allowed to play music on your robot. It is somewhere in the official Q & A’s

I asked about it, got denied and I appealed.

See this thread and this gallery post for a good option for Cortex Audio.


  • Dean

i always wondered what the SP port was for… for some reason i thought it was for SPecial stuff! LOL