SOMO-14D Embedded Audio-Sound Module - Project Showcase - Netduino Forums
   
Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

SOMO-14D Embedded Audio-Sound Module


  • Please log in to reply
5 replies to this topic

#1 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 12 February 2012 - 02:11 PM

Last weekend I made a small class to drive the SOMO-14D module.
It's perhaps not the cheapest audio solution, but it works, easy to connect, and it can hold 512 tracks on a µSD-card (no SDHC-support though!)

I made a small sample video:
http://www.youtube.com/watch?v=KDN4hDNWv3A

How to use it?
/*
 * This sample uses 5 files on the SD-card. They can be found in netmftoolbox\Samples\Visual C#\Sound Module\samples
 */
public static ushort EXTERMINATE = 0;
public static ushort WAAAAAAAAAAAA = 1;
public static ushort YOUMAYNOTLEAVE = 2;
public static ushort TARDIS = 3;
public static ushort SONIC = 4;

public static void Main()
{
    // The module is connected to these pins
    Somo SoundModule = new Somo(Pins.GPIO_PIN_D0, Pins.GPIO_PIN_D1, Pins.GPIO_PIN_D2);

    // Sets the volume fully open
    SoundModule.SetVolume(7);

    // Plays "Exterminate!"
    Debug.Print("EXTERMINATE");
    SoundModule.PlayTrack(EXTERMINATE, true);

    // Plays the Tardis-sound
    Debug.Print("TARDIS");
    SoundModule.PlayTrack(TARDIS, true);

    // Plays "You may not leave my precence!"
    Debug.Print("YOUMAYNOTLEAVE");
    SoundModule.PlayTrack(YOUMAYNOTLEAVE, true);

    // Plays the sonic screwdriver sound
    Debug.Print("SONIC");
    SoundModule.PlayTrack(SONIC, true);

    // Repeatedly play "Waaaaaaaaa!"
    Debug.Print("WAAAAAAAAAAAA (repeated)");
    SoundModule.PlayRepeat(WAAAAAAAAAAAA);

    // Let this go on infinitely
    Thread.Sleep(Timeout.Infinite);
}

You can download the source code here

Now let your Netduino talk!
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#2 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 12 February 2012 - 04:07 PM

*** SIMPLY AMAZING !!! *** I want it! ...BTW, congrats for the video+sources, though! Cheers
Biggest fault of Netduino? It runs by electricity.

#3 NeonMika / Markus VV.

NeonMika / Markus VV.

    Advanced Member

  • Members
  • PipPipPip
  • 209 posts
  • LocationUpper Austria

Posted 27 March 2012 - 03:11 PM

...BTW, congrats for the video+sources, though!





Yeah, your video is really cool =)





Greets

NeonMika.Webserver
> Control your N+ and write webservice methods easyily
> Receive data from you N+ (in XML or JSON)
> Browse the SD on your N+ directly in the browser and d
own - and upload files

 

If you need help with NeonMika.Webserver, please just leave a note in the thread and/or contact me via Skype :)

 

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
--- Mistakes teach you important lessons. Every time you make one, you are one step closer to your goal. ----
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------


#4 atabou

atabou

    New Member

  • Members
  • Pip
  • 1 posts

Posted 24 October 2012 - 07:23 AM

Hi I don't know if you can help me because I don't use arduino. I am currently trying to command the somo in serial mode using an AVR ATmega48 in the beginning and then I'm planing on migrating to a Xmega128. In any case I'm programming using C code with the CodeVision compiler. So far I've written the following code taking some lines out of the forums in the web, but I still can't get to communicate with the somo. I checked the waveforms in Proteus and seems that I can not adjust the timing in a proper way.


Here is the code:
-------------------------------------------------------------------------------------------------
#include <mega48.h>
 
 
#include <stdio.h>
#include <delay.h>
 
//PORTC.2 ia the resest pin
//PORTC.1 is the clock pin
//PORTC.0 is the data pin
 
 
void reset(void)                            //subroutine to reset somo
{
    PORTC.2=0; //pin de reset en bajo
    delay_ms(6);
    PORTC.2=1; //vuelve a estar en alto el pinde reset para permitir el funcionamiento nomral del robot
}
 
void envia_comando (unsigned int ThisSong)  //subroutine to send the command 
{
    unsigned int TheSong = ThisSong;
    unsigned int ClockCounter = 0;  
    
    reset();        //se resetea el módulo para enviar una nueva instrucción
    
    PORTC.0=0;      //data
    PORTC.1=1;      //clock            
    delay_ms(300);
    
    PORTC.1=0;      //clock
    delay_ms(2);
    PORTC.1=1;
 
    while(ClockCounter<= 15 )
    {
        //PORTC.0=0;             //pone el pin de datos en bajo 
        if (TheSong & 0x8000)
        {
                PORTC.0=1;     //pone el pin de datos en alto
        }                
        else
        {
                PORTC.0=0;     //pone el pin de datos en bajo
        }  
        PORTC.1=1;             //pone el pin de reloj en alto 
        delay_us(50); 
        TheSong = TheSong << 1;          
        PORTC.1=0;             //pone el pin de reloj en bajo      
        delay_us(50);
        ClockCounter++ ;             
    }                 
    PORTC.0=0;              //pone el pin de datos en bajo 
    PORTC.1=1;                  //pone el pin de reloj en alto
    delay_ms(20);  
    
}
 
void main(void)
{
 
DDRC = 0b00001011;
PORTC = 0x00;
DDRD = 0x00;
PORTD = 0x00;
PORTC.2 = 1;
 
     
while (1)
      {
      // Place your code here  
       if( PORTD.2)
       {     
          delay_ms(500);
           if(!PORTD.2)
           {            
               envia_comando(0x000A);            //for example I want to play track number 10
           }      
       }
     }
      
}

Thanks a lot if someone can give me a hand. or some ideas to make it better.

Edited by Chris Walker, 05 November 2012 - 04:18 AM.
added [code][/code] tags


#5 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 05 November 2012 - 04:19 AM

Hi atabou,

Hi I don't know if you can help me because I don't use arduino. I am currently trying to command the somo in serial mode using an AVR ATmega48 in the beginning and then I'm planing on migrating to a Xmega128.

I'd recommend raising this question in the Arduino forum. We typically only deal with ARM-based microcontrollers here, not AVR-based ones like Arduino.

Chris

#6 Giuliano

Giuliano

    Advanced Member

  • Members
  • PipPipPip
  • 361 posts
  • LocationSimi Valley, CA

Posted 22 October 2014 - 02:26 AM

Hi Stefan,

 

Do you happen to know if the Sparkfun WTV020SD would work with your library out of the box?






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.