Created
January 28, 2020 09:41
-
-
Save ThaiEasyElec/e8295bca511e34744a9c02a9eea4177c to your computer and use it in GitHub Desktop.
DTMF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SoftwareSerial.h> | |
char c=0; | |
char str[40]; | |
char cnt=0; | |
int busy = 2; | |
int LED1 = 3; | |
int LED2 = 4; | |
int LED3 = 5; | |
int LED4 = 6; | |
String password="1234"; | |
char no_carroer=0; | |
String gen_dtmf[4] ={"AT+QWDTMF=7,0,\"", ",50,50\""}; | |
void setup() | |
{ | |
pinMode(busy, INPUT); | |
pinMode(LED1, OUTPUT); | |
pinMode(LED2, OUTPUT); | |
pinMode(LED3, OUTPUT); | |
pinMode(LED4, OUTPUT); | |
digitalWrite(LED1,HIGH); | |
digitalWrite(LED2,HIGH); | |
digitalWrite(LED3,HIGH); | |
digitalWrite(LED4,HIGH); | |
Serial.begin(9600);//PC | |
Serial.flush(); | |
delay(500); | |
Serial.println("DTMF Demo"); | |
Serial2.begin(9600);//GSM M10 | |
Serial1.begin(9600);//MP3 Module | |
Serial2.flush(); | |
delay(1000); | |
Serial2.println("AT"); | |
delay(1000); | |
Serial2.println("ATE0");//Close Echo M10 | |
delay(1000); | |
Serial2.println("AT+QTONEDET=1");//Open Detect DTMF M10 | |
Serial1.write(215);//Set volume MP3 | |
Serial.println("Ready"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment