fix mute in ctcss example

This commit is contained in:
Morgan Redfield 2018-08-17 19:25:38 -07:00
parent 0b6d1a3cac
commit 88264e1998
1 changed files with 9 additions and 5 deletions

View File

@ -101,7 +101,7 @@ void setup() {
Serial.print("ctcss tone: ");
Serial.println(radio.getCtcssFreqHz());
// mute audio until we get a CTCSS tone
// radio.setMute();
radio.setMute();
muted = true;
// configure Arduino LED for
@ -117,13 +117,13 @@ void loop() {
if (radio.getCtcssToneDetected()) {
if (muted) {
muted = false;
// radio.setUnmute();
radio.setUnmute();
Serial.println("tone");
}
} else {
if (!muted) {
muted = true;
// radio.setMute();
radio.setMute();
Serial.println("no tone");
}
}
@ -139,13 +139,17 @@ void loop() {
// set to transmit
radio.setModeTransmit();
Serial.println("Tx");
//radio.setTxSourceMic();
//radio.setRfPower(1);
radio.setUnmute(); // can't mute during transmit
muted = false;
}
} else if (currently_tx) {
radio.setModeReceive();
currently_tx = false;
Serial.println("Rx");
radio.setMute(); // default to mute during rx
muted = true;
}
// handle serial commands