Skip to content

Commit 18f6836

Browse files
Add files via upload
1 parent 4ed7d73 commit 18f6836

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

Arduino Sketch/AudioControl/AudioControl.ino

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
int analogPin = A10; // potentiometer wiper (middle terminal) connected to analog pin 3
2-
// outside leads to ground and +5V
1+
int analogPin = A0; // potentiometer wiper (middle terminal) connected to analog pin 0
2+
33
int val1 = 0; // variable to store the value read
44
int val1_old = 0;
55
String incomingMsg = "";
6-
int intNRLevel = 3; //the higher the number, the greate the noise reduction; 0=disabled
6+
int intNRLevel = 3; //the higher the number, the greate the noise reduction; 0=disabled. DO NOT CHANGE. This can be modified using the Systray application
77
int arrNoiseReduction[3] = {-1,-1,-1}; //Array used for NoiseReduction
88
//String message = "";
99

@@ -57,17 +57,13 @@ void Incoming(){
5757
if (Serial.available() > 0) {
5858
// read the incoming byte:
5959
incomingMsg = Serial.readString();
60-
if (incomingMsg.indexOf("syn")>-1){
61-
Serial.println("ack");
62-
} else if (incomingMsg.indexOf("get")>-1){
63-
Serial.println(String(val1/2));
64-
} else if (incomingMsg.indexOf("NR=")>-1){
60+
if (incomingMsg.indexOf("syn")>-1){Serial.println("ack");} //used to autodetect the device
61+
if (incomingMsg.indexOf("get")>-1){Serial.println(String(val1/2));} //send current value on request
62+
if (incomingMsg.indexOf("NR=")>-1){ //Acknowledge Noise reduction set on request
6563
intNRLevel = incomingMsg.substring(3,4).toInt();
6664
Serial.println("NR=" + String(intNRLevel));
6765
//Set intNRLevel
68-
} else {
6966
}
70-
7167
}
7268
}
7369

0 commit comments

Comments
 (0)