msouth
0
Q:

grabar microfono en tarjeta arduino sd

//Video en youtube https://www.youtube.com/watch?v=hc0wBjrO2WY
//Apoya mi canal suscribete en http://www.youtube.com/user/carlosvolt?sub_confirmation=1
//Link del proyecto http://rogerbit.com/wprb/index.php/2015/12/19/audio-con-arduino/
//Únete en facebook en https://www.facebook.com/groups/RogerBit
//Página del autor original http://www.hackerspace-ffm.de/wiki/index.php?title=SimpleSDAudio
#include <SimpleSDAudio.h>
//declaración de variables
const int boton1 = 1;
int buttonState1 = 0;
const int boton2 = 2;
int buttonState2 = 0;
const int boton3 = 3;
int buttonState3 = 0;
const int boton5 = 5;
int buttonState5 = 0;
const int boton6 = 6;
int buttonState6 = 0;
const int boton7 = 7;
int buttonState7 = 0;
const int boton8 = 8;
int buttonState8 = 0;
 
void setup()
{ 
 // SdPlay.setSDCSPin(10); // Habilitar SÓLO si su tarjeta SD no está en el pin número 4 
SdPlay.init(SSDA_MODE_HALFRATE | SSDA_MODE_MONO | SSDA_MODE_AUTOWORKER);
//Setea los pines 1,2,3,5,6,7,8 como entratdas para los pulsadores
pinMode(boton1, INPUT);
pinMode(boton2, INPUT);     
pinMode(boton3, INPUT);       
pinMode(boton5, INPUT);     
pinMode(boton6, INPUT);     
pinMode(boton7, INPUT);     
pinMode(boton8, INPUT);
}
 
void loop(void) {
//lee estado de los pulsadores por si alguno ha sido precionado
buttonState1 = digitalRead(boton1);
buttonState2 = digitalRead(boton2);
buttonState3 = digitalRead(boton3);
buttonState5 = digitalRead(boton5);
buttonState6 = digitalRead(boton6);
buttonState7 = digitalRead(boton7);
buttonState8 = digitalRead(boton8);
 
//si el pulsador 1 fue precionado 
if (buttonState1 == HIGH) { 
  SdPlay.setFile("aa.wav");//con setFile vamos a cargar el archivo que queremos reproducir
  SdPlay.play(); // play reproduciomos el archivo  
   }
//si el pulsador 2 fue precionado 
if (buttonState2 == HIGH) {
  SdPlay.stop(); 
   SdPlay.setFile("pre1.wav");//con setFile vamos a cargar el archivo que queremos reproducir
   SdPlay.play();  // play reproduciomos el archivo  
   }
   
if (buttonState3 == HIGH) { 
 SdPlay.setFile("musica.wav");
 SdPlay.play();  
   }
 
   
if (buttonState5 == HIGH) { 
   SdPlay.setFile("ad.wav");
 SdPlay.play();   
   }
 
 
if (buttonState6 == HIGH) { 
   SdPlay.setFile("as.wav");
 SdPlay.play();   
   }
   
if (buttonState7 == HIGH) { 
   SdPlay.setFile("ag.wav");
 SdPlay.play();   
   }
 
if (buttonState8 == HIGH) { 
   SdPlay.setFile("desp3.wav");
 SdPlay.play();   
   }  
}
0

New to Communities?

Join the community