Prompt:
A device that allows a person to control media on a personal computer using communication between a microcontroller and the personal computer using asynchronous serial communication.
Project:
Created an atmospheric visualizer and looper to immerse the user in an experimental and curious exploration.
The microcontroller included 4 sliding potentiometers (speed, hue, variation, and volume) and 4 button switches (various synths).
Arduino microcontroller code:
const int buttonPinA = 4; // digital input
const int buttonPinB = 5;
const int buttonPinC = 6;
const int buttonPinD = 7;
void setup() {
// configure the serial connection:
Serial.begin(9600);
// configure the digital input:
pinMode(buttonPinA, INPUT);
pinMode(buttonPinB, INPUT);
pinMode(buttonPinC, INPUT);
pinMode(buttonPinD, INPUT);
}
void loop() {
// slider 1: speed
int sensorValue = analogRead(A0);
// print the results:
Serial.print(sensorValue);
Serial.print(",");
// slider 2: hue
sensorValue = analogRead(A1);
// print the results:
Serial.print(sensorValue);
Serial.print(",");
// slider: variation
sensorValue = analogRead(A2);
// print the results:
Serial.print(sensorValue);
Serial.print(",");
// volune of background music
sensorValue = analogRead(A3);
// print the results:
Serial.print(sensorValue);
Serial.print(",");
// read the button:
sensorValue = digitalRead(buttonPinA);
// print the results:
Serial.print(sensorValue);
Serial.print(",");
// read the button:
sensorValue = digitalRead(buttonPinB);
// print the results:
Serial.print(sensorValue);
Serial.print(",");
// read the button:
sensorValue = digitalRead(buttonPinC);
// print the results:
Serial.print(sensorValue);
Serial.print(",");
// read the button:
sensorValue = digitalRead(buttonPinD);
// print the results:
Serial.println(sensorValue);
delay(500);
}
Visualizer code:
I took this open source Code Pen and added serial port to connect with the microcontroller code. Link to full code
I then projected it onto seamless paper with a projector, hdmi cable, and speakers to scale the experience.
No comments.