Removed dialing of 5 to turn off speaker, added toggle for number 4 (speaker off/speaker on).

This commit is contained in:
GRMrGecko 2014-01-29 17:15:02 -06:00
parent 1f2230c2cb
commit bb5dd175f4
3 changed files with 11 additions and 4 deletions

View File

@ -24,6 +24,7 @@ int phoneNumber[10] = {0,0,0,0,0,0,0,0,0,0};
int numberCount = 0; int numberCount = 0;
int speakerShutOffPin = 9; int speakerShutOffPin = 9;
int speakerShutOffToggle = 0;
typedef enum { typedef enum {
limbo = 0, limbo = 0,
@ -101,6 +102,7 @@ void getAndDecodeState() {
if (state==incomingCall) { if (state==incomingCall) {
digitalWrite(speakerShutOffPin, HIGH); digitalWrite(speakerShutOffPin, HIGH);
} else if (state!=audioStreaming && state!=connected) { } else if (state!=audioStreaming && state!=connected) {
speakerShutOffToggle = 0;
digitalWrite(speakerShutOffPin, LOW); digitalWrite(speakerShutOffPin, LOW);
} }
free(stateHex); free(stateHex);
@ -185,6 +187,7 @@ void loop() {
} else { } else {
if (state==incomingCall || state==incomingCallHold) { if (state==incomingCall || state==incomingCallHold) {
serialSendVerify("C\r", "AOK"); serialSendVerify("C\r", "AOK");
speakerShutOffToggle = 0;
digitalWrite(speakerShutOffPin, LOW); digitalWrite(speakerShutOffPin, LOW);
} }
} }
@ -208,10 +211,14 @@ void loop() {
} else if (dialedNumber==3) { } else if (dialedNumber==3) {
serialSendVerify("AP\r", "AOK"); serialSendVerify("AP\r", "AOK");
} else if (dialedNumber==4) { } else if (dialedNumber==4) {
if (speakerShutOffToggle==0) {
speakerShutOffToggle = 1;
digitalWrite(speakerShutOffPin, HIGH); digitalWrite(speakerShutOffPin, HIGH);
} else if (dialedNumber==5) { } else {
speakerShutOffToggle = 0;
digitalWrite(speakerShutOffPin, LOW); digitalWrite(speakerShutOffPin, LOW);
} }
}
} else if (hook==0) { } else if (hook==0) {
if (dialedNumber==3) { if (dialedNumber==3) {
serialSendVerify("AP\r", "AOK"); serialSendVerify("AP\r", "AOK");

View File

@ -2,7 +2,7 @@
Rtoary Gecko is my work to convert a Rotary Phone into a Bluetooth Phone. You can dial numbers, and answer phone calls with your cell phone as the man in the middle that provides cell service. Rtoary Gecko is my work to convert a Rotary Phone into a Bluetooth Phone. You can dial numbers, and answer phone calls with your cell phone as the man in the middle that provides cell service.
The documents stored here are the major documents needed to make a Rotary Phone Bluetooth. To read my quest to build this Phone, visit my blog at http://mrgecko.org. To get videos/photos and documentation to the hardware which I collected, you can visit my bitcasa share at http://l.bitcasa.com/P3r9r6d1. The documents stored here are the major documents needed to make a Rotary Phone Bluetooth. To read my quest to build this Phone, visit my blog at http://mrgecko.org. To get videos/photos and documentation to the hardware which I collected, you can visit my bitcasa share at http://l.bitcasa.com/xlehQejl.
As I do with every code I write, I make it fairly easy to understand with my naming conventions, so there are not many comments to explain things, you should be able to just read it and know what it does. As I do with every code I write, I make it fairly easy to understand with my naming conventions, so there are not many comments to explain things, you should be able to just read it and know what it does.