#include "SD.h" //Lib to read SD card
#include "TMRpcm.h" //Lib to play auido
#include "SPI.h" //SPI lib for SD card
#define SD_ChipSelectPin 13 //Chip select is pin number 13
TMRpcm audio; //Lib object is named "audio"
int wheel = 2;
int button = 4;
int lever1 = 7;
int lever2 = 8;
int led1 = 14;
int led2 = 15;
int led3 = 16;
int led4 = 17;
int led5 = 18;
void setup() {
audio.speakerPin = 9; //Auido out on pin 9
Serial.begin(9600); //Serial Com for debugging
if (!SD.begin(SD_ChipSelectPin))
Serial.println("SD fail");
return;
}
pinMode(wheel,INPUT_PULLUP); //Button 1 with internal pull up WHEEL
pinMode(button,INPUT); //Button 2 with internal pull up BUTTON
pinMode(lever1,INPUT); //Button 3 with internal pull LEVER 1
pinMode(lever2,INPUT); //button 4 WITH PULL UP LEVER2
pinMode(led1,OUTPUT); //led1
pinMode(led2,OUTPUT); //led2
pinMode(led3,OUTPUT); //led3
pinMode(led4,OUTPUT);
pinMode(led5,OUTPUT);
audio.setVolume(5); // 0 to 7. Set volume level
audio.quality(1); // Set 1 for 2x oversampling Set 0 for normal
//audio.volume(0); // 1(up) or 0(down) to control volume
//audio.play("filename",30); plays a file
void loop() {
if (digitalRead(wheel) == HIGH) //WHEEL IS ROTATED
audio.play((char *)"wheel.wav"); //Play WHEEL
digitalWrite(led1, HIGH); //light led1
if (digitalRead(button) == LOW) //WHEEL IS NOT ROTATED
digitalWrite(led2, LOW); //led off
if (digitalRead(button) == HIGH) //Button 2 Pressed
audio.play((char *)"button.wav"); //Play BUTTON
digitalWrite(led2, HIGH); // led on
if (digitalRead(button) == LOW) //Button 2 NOTPressed
digitalWrite(led2, LOW); // led off
if (digitalRead(lever1) == HIGH) //LEVER 1 IS SWICHED
audio.play((char *)"lever1.wav"); //Play LEVER1
digitalWrite(led3, HIGH);//led on
if (digitalRead(lever1) == LOW) //LEVER 1 IS NOT SWICHED
digitalWrite(led3, LOW);//led off
if (digitalRead(lever2) == HIGH) //LEVER 2 IS SWICHED
audio.play((char *)"lever2.wav"); //Play LEVER2
digitalWrite(led4, HIGH);//led on
if (digitalRead(lever2) == LOW) //LEVER 2 IS NOT SWICHED
digitalWrite(led4, LOW); // led off
if (digitalRead(wheel), (button), (lever1), (lever2) == HIGH) //EVERYTHING IS PRESENT
audio.play((char *)"wheel.wav"); //Play FANFARE
digitalWrite(led5, HIGH); //led on
}
C:\Users\mark\Desktop\VENDOR\VENDOR.ino: In function 'void loop()':
C:\Users\mark\Desktop\VENDOR\VENDOR.ino:45:28: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
audio.play("wheel.wav"); //Play WHEEL
^
C:\Users\mark\Desktop\VENDOR\VENDOR.ino:58:34: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
audio.play("button.wav"); //Play BUTTON
^
C:\Users\mark\Desktop\VENDOR\VENDOR.ino:68:38: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
audio.play("lever1.wav"); //Play LEVER1
^
C:\Users\mark\Desktop\VENDOR\VENDOR.ino:78:42: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
audio.play("lever2.wav"); //Play LEVER2
^
C:\Users\mark\Desktop\VENDOR\VENDOR.ino:90:45: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
audio.play("fanfare.wav"); //Play FANFARE
^
VENDOR:96:17: error: expected '}' at end of input
}
^
VENDOR:96:17: error: expected '}' at end of input
VENDOR:96:17: error: expected '}' at end of input
VENDOR:96:17: error: expected '}' at end of input
VENDOR:96:17: error: expected '}' at end of input
VENDOR:96:17: error: expected '}' at end of input
VENDOR:96:17: error: expected '}' at end of input
VENDOR:96:17: error: expected '}' at end of input
exit status 1
expected '}' at end of input
thats the full thing again, many thanks for helping Paul cant beleve im still awake.