Removed unnecesary code from arduino audio visualizer
This commit is contained in:
@@ -14,19 +14,12 @@ void setup() {
|
|||||||
input.start();
|
input.start();
|
||||||
analyzer = new Amplitude(this);
|
analyzer = new Amplitude(this);
|
||||||
analyzer.input(input);
|
analyzer.input(input);
|
||||||
}
|
}
|
||||||
|
|
||||||
void draw() {
|
void draw() {
|
||||||
float vol = analyzer.analyze();
|
float vol = analyzer.analyze();
|
||||||
float normal = 10+vol*200;
|
float normal = 10+vol*200;
|
||||||
|
|
||||||
int out = int(map(normal, 0, 60, 0, 11));
|
int out = int(map(normal, 0, 60, 0, 11));
|
||||||
|
|
||||||
if (port.available() > 0) {
|
|
||||||
String s = port.readString();
|
|
||||||
println(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
port.write(Integer.toString(out));
|
port.write(Integer.toString(out));
|
||||||
port.write(" ");
|
port.write(" ");
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user