//Sample code to test triggering the RadioShack recording module via Arduino. 

int playPin = 3; // wire to one button
int recordPin = 5; //wire to another button
int speakPin = 9; //to speaker wire
int micPin = 10; //to mic wire

int val1 = 0; //this will be a read of one button
int val2 = 0; //this will be a read of the other

void setup() {

//set up your buttons as inputs; set your mic and speaker as outputs
  pinMode(playPin, INPUT);
  pinMode(recordPin, INPUT);
  pinMode(micPin, OUTPUT);
  pinMode(speakPin, OUTPUT);

}

void loop() {

//define the values being read
  val1 = digitalRead(recordPin);
  val2 = digitalRead(playPin);

//if you push the button, you want it to activate the recording. otherwise you don't want anything to happen!

  if (val1 == HIGH) {
    digitalWrite(micPin, LOW);
  } else {
    digitalWrite(micPin, HIGH);

  }

//if you push the button, you want it to activate the playback. otherwise you don't want anything to happen!

  if (val2 == HIGH) {
    digitalWrite(speakPin, LOW);
  } else {
    digitalWrite(speakPin, HIGH);
  }
}