this is the program for my project its if the motors rpm is higher than 20 per sec then it will play an audio file,the arduino ide says that it has error compiling can someone pls tell me if something is wrong with my code thank u
#include "TimerOne.h"
#include <SD.h>
#include <TMRpcm.h>
#define SD_ChipSelectPin 4
TMRpcm tmrpcm;
unsigned int counter = 0;
void docount()
{
counter++;
}
void timerIsr()
{
Timer1.detachInterrupt();
Serial.print("Motor Speed: ");
int rotation = (counter / 1);
Serial.print(rotation, DEC);
if (rotation > 20) {
if (!SD.begin(SD_ChipSelectPin)) {
return;
}
else {
tmrpcm.play("1.wav");
}
}
Serial.println(" Rotation per seconds");
counter = 0;
Timer1.attachInterrupt( timerIsr );
}
void setup()
{
tmrpcm.setVolume(5);
Timer1.initialize(1000000);
attachInterrupt(0, docount, RISING);
Timer1.attachInterrupt( timerIsr );
}
void loop()
{
}
here,s the error message
Arduino: 1.8.2 (Windows 7), Board: "Arduino/Genuino Uno"
C:\Users\bocs\Documents\Arduino\sketch_aug19a\sketch_aug19a.ino: In function 'void timerIsr()':
C:\Users\bocs\Documents\Arduino\sketch_aug19a\sketch_aug19a.ino:28:26: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
tmrpcm.play("1.wav");
^
libraries\TMRpcm-master\TMRpcm.cpp.o (symbol from plugin): In function `sFile':
(.text+0x0): multiple definition of `__vector_13'
libraries\TimerOne-r11\TimerOne.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino/Genuino Uno.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.