Made arduino EQ and made a discord selfbot

This commit is contained in:
plane000
2018-06-07 22:07:19 +01:00
parent 41e3824033
commit c683c88a73
12 changed files with 551 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
void setup(){
for (int i = 3; i <= 13; i++) {
pinMode(i, OUTPUT);
}
for (int i = 3; i <= 13; i++) {
digitalWrite(i, HIGH);
delay(100);
}
Serial.begin(9600);
while (!Serial) {
;
}
for (int i = 0; i < 4; i++) {
delay(100);
allOn();
delay(100);
allOff();
}
}
void loop(){
while (Serial.available() > 0) {
int numOfLights = Serial.parseInt() + 3;
allOff();
for (int i = 0; i < numOfLights; i++) {
digitalWrite(i, HIGH);
}
}
}
void allOff() {
for (int i = 3; i <= 13; i++) {
digitalWrite(i, LOW);
}
}
void allOn() {
for (int i = 3; i <= 13; i++) {
digitalWrite(i, HIGH);
}
}

View File

@@ -0,0 +1,32 @@
import processing.serial.*;
import processing.sound.*;
AudioIn input;
Amplitude analyzer;
Serial port;
void setup() {
size(200, 200);
port = new Serial(this, "COM3", 9600);
input = new AudioIn(this, 0);
input.start();
analyzer = new Amplitude(this);
analyzer.input(input);
}
void draw() {
float vol = analyzer.analyze();
float normal = 10+vol*200;
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(" ");
}