Compiling issues with main file

I'm trying to get the main file to compile and getting nowhere fast on account of having next to no knowledge of the C++ language. It needs to be in control of 3 sound files that will be uploaded to the on-board memory of my Teensy 3.1.

Here is my code so far:

int inPin = 14; int val = 0;

include "mngs1.h";

include "mngs2.h";

include "mngs3.h";

AudioPlayMemory gunSound;

void setup() { pinMode(inPin, INPUT); //Sets the digital pin as input } void loop() { val = digitalRead(inPin); //Read input pin IF val == HIGH gunSound.play (mngs1.h); void loop() { val = digitalRead(inPin); while val == HIGH; gunSound.play(mngs2.h); } gunSound.play(mngs3.h); } ...

I'm having problems with it accepting the AudioPlayMemory function without a "," or ";" before it and it says i haven't declared gunSound.

Any help in this would be much appreciated.

IF val == HIGH

Have you seen any of the IDE examples that have an "if" looking like that?

Also, you can't embed a function called loop inside another function called loop, or indeed any function.

When you look at the errors being reported, rather than cherry pick the ones you find interesting, start with the first one reported and work through them in order.

The code you have here will have errors of higher priority than the one you are reporting here.