Removed dialing of 5 to turn off speaker, added toggle for number 4 (speaker off/speaker on).
This commit is contained in:
parent
1f2230c2cb
commit
bb5dd175f4
@ -24,6 +24,7 @@ int phoneNumber[10] = {0,0,0,0,0,0,0,0,0,0};
|
||||
int numberCount = 0;
|
||||
|
||||
int speakerShutOffPin = 9;
|
||||
int speakerShutOffToggle = 0;
|
||||
|
||||
typedef enum {
|
||||
limbo = 0,
|
||||
@ -101,6 +102,7 @@ void getAndDecodeState() {
|
||||
if (state==incomingCall) {
|
||||
digitalWrite(speakerShutOffPin, HIGH);
|
||||
} else if (state!=audioStreaming && state!=connected) {
|
||||
speakerShutOffToggle = 0;
|
||||
digitalWrite(speakerShutOffPin, LOW);
|
||||
}
|
||||
free(stateHex);
|
||||
@ -185,6 +187,7 @@ void loop() {
|
||||
} else {
|
||||
if (state==incomingCall || state==incomingCallHold) {
|
||||
serialSendVerify("C\r", "AOK");
|
||||
speakerShutOffToggle = 0;
|
||||
digitalWrite(speakerShutOffPin, LOW);
|
||||
}
|
||||
}
|
||||
@ -208,9 +211,13 @@ void loop() {
|
||||
} else if (dialedNumber==3) {
|
||||
serialSendVerify("AP\r", "AOK");
|
||||
} else if (dialedNumber==4) {
|
||||
digitalWrite(speakerShutOffPin, HIGH);
|
||||
} else if (dialedNumber==5) {
|
||||
digitalWrite(speakerShutOffPin, LOW);
|
||||
if (speakerShutOffToggle==0) {
|
||||
speakerShutOffToggle = 1;
|
||||
digitalWrite(speakerShutOffPin, HIGH);
|
||||
} else {
|
||||
speakerShutOffToggle = 0;
|
||||
digitalWrite(speakerShutOffPin, LOW);
|
||||
}
|
||||
}
|
||||
} else if (hook==0) {
|
||||
if (dialedNumber==3) {
|
||||
|
Binary file not shown.
@ -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.
|
||||
|
||||
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.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user