<< back to home

Harmony Machine

Blog

I am working on a project as part of my coursework in which I need to create a prototype for a installation. The installation must tell a narrative through non-traditional techiniques and must be executed using computer technolocgies. I have decided to design an installation called Harmony Machine.



Servo

Getting the servo up and running was actually quite easy. Plugged servo into the groud and 5v power ports, as well as digital port 9.



I copied this sweep code from the Arduino website into the IDE. Arrow brackets have been replaced with '(AB)'.


#include (AB)Servo.h(AB)

Servo myservo; // create servo object to control a servo
// twelve servo objects can be created on most boards

int pos = 0; // variable to store the servo position
bool servoOn = false; //an on and off swtitch so the servo doesn't drive me mad while working

void setup() {
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}

void loop() {
if(servoOn == true) { // if func to make on/off 'switch' work
for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees
// in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}
}

Creative Coding

To do

+ Explore 'kinetic typography'



Useful resources

Official Processing refernce direcectory.

Open Processing - a space to create processing prgrams online, for conveinence and to be shared.

Copy and Paste Function - Tim Rodenbroeker Creative Coding (Generative visual art in Processing java and p5.js.)

Processing tutorials & Generative art - by Creative Coderie.