I get error messages:
'index1' was not declared in this scope
'index2' was not declared in this scope
initializer expression list treated as compound expression
There are others but I think that I can figure them out. Any help for this duffer?
Also, the way you got it setup now, INPUTPIN will never go low, nor high, as you defined it as a constant.
I think what you'd want is:
if (digitalRead(INPUTPIN)==LOW)
Also, I just tested your code. The error is coming from your function makesound. You didn't define what the inputs where.
Void makesound (byte index1, byte index2){
Edit: I changed makesound to void, as you aren't returning anything anyways. Code compiles on my machine with no errors, although I don't think it will do what you expect it to do. Check over your INPUTPIN. Remember that define replaces all instances of INPUTPIN by 2, so in your Setup code, you are making INPUTPIN == HIGH; will return true, but that isn't changing anything?
When posting code, please use the # icon on the editors toolbar to put the code into a code box.
Please go back to your post, click on "modify', highlight the code, click on the # icon, then click on "save".
Also, why bother commenting a binary constant with the hex value which doesn't reflect the binary value?
Got it. I put the code into a code box, sorry about that. I will make the mods suggested here and go from there. INPUTPIN will be a hardware switch for test purposes and then a sensor input in the final project.