Offline
Newbie
Karma: 0
Posts: 4
|
 |
« on: April 11, 2011, 10:04:46 pm » |
I'm using Sparkfun's isd1932 voice record breakout. I connect breakout to the arduino mini like the example of data sheet and make a button to give signal (i'm using direct mode) and i can't record anything. when I press the button, it can print "Record!" but breakout doesn't work. What can be a problem?
//define pin# int M[] = {7, 8, 9}; // Messege pin int FMC[] = {12, 11, 13}; // control # of messege int rButton=2; // record int pButton=5; // play int rVal=0; //value of recording button int pVal=0; //value of play button int RePlay = 10; // RE/Play signal pin int FT=6; // floating
int pinCount = 3; int Mstate[3]; // messege access int RecNum=0; // Recording stack
void setup(){ Serial.begin(9600); for(int i=0;i<pinCount;i++){ pinMode(M,OUTPUT); pinMode(FMC,OUTPUT); Mstate=HIGH; digitalWrite(M,Mstate); } pinMode(rButton, INPUT); pinMode(pButton, INPUT); pinMode(RePlay, OUTPUT); pinMode(FT, OUTPUT); digitalWrite(FT, HIGH); digitalWrite(FMC[0], LOW); digitalWrite(FMC[1], HIGH); digitalWrite(FMC[2], LOW); // # of messege setup digitalWrite(RePlay, HIGH); // basic : play mode }
void loop(){ rVal=digitalRead(rButton); pVal=digitalRead(pButton); if(rVal == HIGH) { digitalWrite(RePlay, LOW); Mstate[0]=LOW; pulseIn(M[0], Mstate[0], 1500); Serial.println("Record!"); /* for(int Rec=0; RecNum<3; Rec++){ if({ pulseIn(RePlay, LOW); // Recording activate M[1]state=LOW; pulseIn(M[Rec], Mstate[Rec]); // give the siganl to record break; } }*/ } if(pVal == HIGH) { digitalWrite(RePlay, HIGH); Mstate[0]=LOW; pulseIn(M[0], Mstate[0], 1500); Serial.println("play!"); } }
|