Removed unnecesary code from arduino audio visualizer

This commit is contained in:
plane000
2018-06-07 22:15:19 +01:00
parent c683c88a73
commit ef72d19b2e

View File

@@ -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(" ");
} }