You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Arduino Sketch/AudioControl/AudioControl.ino
+6-10Lines changed: 6 additions & 10 deletions
Original file line number
Diff line number
Diff 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
+
3
3
int val1 = 0; // variable to store the value read
4
4
int val1_old = 0;
5
5
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
7
7
int arrNoiseReduction[3] = {-1,-1,-1}; //Array used for NoiseReduction
8
8
//String message = "";
9
9
@@ -57,17 +57,13 @@ void Incoming(){
57
57
if (Serial.available() > 0) {
58
58
// read the incoming byte:
59
59
incomingMsg = Serial.readString();
60
-
if (incomingMsg.indexOf("syn")>-1){
61
-
Serial.println("ack");
62
-
} elseif (incomingMsg.indexOf("get")>-1){
63
-
Serial.println(String(val1/2));
64
-
} elseif (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
0 commit comments