Skip to content

Instantly share code, notes, and snippets.

@ThaiEasyElec
Created January 28, 2020 09:57
Show Gist options
  • Save ThaiEasyElec/29f143db9205df5399deec97962018a9 to your computer and use it in GitHub Desktop.
Save ThaiEasyElec/29f143db9205df5399deec97962018a9 to your computer and use it in GitHub Desktop.
DTMF
void wait_Ring(void)
{
char RingConunt=0;
char RingTime=3;
no_carroer=0;
while(1)
{
String data = rx_m10();
if(data == "RING")
{
Serial.println("Ring");
RingConunt++;
if(RingConunt==RingTime)
{
Serial.println("operate");
RingTime=0;
Serial2.println("ATA");
delay(500);
Serial1.write(0x01);
delay(10);
while(!digitalRead(busy)){}
return;
}
}
if(data == "NO CARRIER")
{
RingConunt=0;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment