I used circuit for my project already attached.
I found error on my code. please help me on this.
Here i want to used DF player Mini instead of Wtv020sd16p.
this code show error message " expected ',' or '...' before numeric constant
"
Program:
#include <SoftwareSerial.h>
#include <EEPROM.h>
#include <LiquidCrystal.h>
//#include <dfplayer_mini_mp3.h>
#include <DFRobotDFPlayerMini.h>
#define TX 0
#define RX 1
#define tx 9
#define rx 10
#define busy 7
#define clearMemory 0
#define total 20 //the total number of prohibited statements has been limited to 20
#define State 8 //the state pin of the HC 05 module
#define rs 12
#define en 11
#define d4 5
#define d5 4
#define d6 3
#define d7 2
int address;
int VoiceAddress;
int RandomNumber;
int memory;
int last_Memory;
int State1;
int never[total] = {};
int minNo;
int maxNo;
String voice;
SoftwareSerial DFRobotDFPlayerMini (7, 9, 10);
DFRobotDFPlayerMini (int tx = 9, int rx = 10, int busy = 7);
//dfplayer_mini_mp3 module(dftx, dfrx, busy);
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
SoftwareSerial BT(TX, RX);
// The characters to be displayed on the screen
byte neutral_part[8] = {
0b11111,
0b11111,
0b11111,
0b11111,
0b11111,
0b11111,
0b11111,
0b11111
};
byte blink_part[8] = {
0b00000,
0b00000,
0b00000,
0b00000,
0b00000,
0b11111,
0b11111,
0b11111
};
byte Glee_left[8] = {
0b00000,
0b00000,
0b00111,
0b01111,
0b11111,
0b11111,
0b11100,
0b11000
};
byte Glee_right[8] = {
0b00000,
0b00000,
0b11100,
0b11110,
0b11111,
0b11111,
0b00111,
0b00001
};
byte Sad_left[8] = {
0b00000,
0b00000,
0b10000,
0b11000,
0b11111,
0b11111,
0b01111,
0b00111
};
byte Sad_right[8] = {
0b00000,
0b00000,
0b00001,
0b00011,
0b11111,
0b11111,
0b11110,
0b11100
};
byte Squint_left[8] = {
0b00000,
0b00000,
0b00000,
0b00000,
0b00000,
0b01111,
0b11111,
0b00000
};
byte Squint_right[8] = {
0b00000,
0b00000,
0b00000,
0b00000,
0b00000,
0b11110,
0b11111,
0b00000
};
void setup() {
//pinMode (button, INPUT); //set the button as an input
pinMode(State, INPUT);
BT.begin(9600); //set the bluetooth bandwith to 9600
lcd.begin(16, 2); //initialize the lcd to have 16 columns and 2 rows
memory = clearMemory; //clear the memory
//create the characters
lcd.createChar(0, neutral_part);
//neutral is set as 0
lcd.createChar(1, blink_part);
//blink as 1
lcd.createChar(2, Glee_left);
//glee left as 2
lcd.createChar(3, Glee_right);
//glee right as 3
lcd.createChar(4, Sad_left);
//sad left as 4
lcd.createChar(5, Sad_right);
//sad right as 5
lcd.createChar(6, Squint_left);
//squint left as 6
lcd.createChar(7, Squint_right);
//squint right as 7
module.reset(); //reset the wtv020sd16p module
module.playVoice(262); //say hello to everyone
delay(40); //delay added to make things stable
Neutral();
}
void loop() {
if (State == LOW) { //check and inform if Eve is not connected through Bluetooth
RandomNumber = random(1); //create Random Numbers from 0 to 1
Squint(); //make up the angry-squinting expression
if (RandomNumber == 1)
module.playVoice(0);
else
module.playVoice(1);
}
while (BT.available()) { //while Serial data is available over bluetooth
delay(10); //delay added to make things stable
char c = BT.read(); //conduct a Serial reading of the Bluetooth data
voice += c; //build the strings
}
//starting the commands, the most important function of Eve:
//start from the original Eve commands
if (voice.indexOf("your name") > -1) { //starting from the most common question of introduction
Neutral(); //set up the neutral look of Eve
RandomNumber = random(2, 4); //generate random numbers from the range 2 to 4
minNo = 2;
maxNo = 4;
playBack();
}
else if ((voice.indexOf("address") > -1) || (voice.indexOf("stay") > -1)) { //asking address
Neutral();
RandomNumber = random(5, 7);
minNo = 5;
maxNo = 7;
playBack();
}
else if (voice.indexOf("phone number") > -1) {
Neutral();
RandomNumber = random(8, 10);
minNo = 8;
maxNo = 10;
playBack();
}
else if (voice.indexOf("who asked you") > -1) {
Squint(); //set up the squint face
RandomNumber = random(11, 13);
minNo = 11;
maxNo = 13;
playBack();
}
void Squint() {
blink();//blink before the robot sets in the mood
lcd.clear(); //clear the screen for the current display
delay(200);
lcd.setCursor(6, 0);
lcd.write(byte(6));
lcd.setCursor(7, 0);
lcd.write(byte(7));
lcd.setCursor(9, 0);
lcd.write(byte(6));
lcd.setCursor(10, 0);
lcd.write(byte(7));
}