OctoBeat

Submitted by MarieSpliid on Fri, 04/19/2013 - 17:52
MarieSpliid's picture

 

By: Brian McRae, Thomas May, John Scott, Kate Hsiao & Marie Spliid Kirkegaard

 

Description

OctoBeat is a percussion instrument designed to facilitate a fun and experimental experience of creating percussion music in a collaborative and entertaining way. OctoBeat has 5 arms with hands for each participant to press. Each hand press activates a percussion instrument attached to another separate arm. This way, participants will have to listen and coordinate their hand presses in order to create well composed beats.

Components

  • 4 Arduino boards
  • 4 breadboards
  • 5 servo motors
  • wire
  • plastic tubes
  • styrofoam ball
  • plastic gloves
  • glass, metal and other materials for percussion instruments and sound components

 


Code

As we have seperate computers/Arduinos connected to each arm/instrument (except for two that are merged) the individual code pieces vary a bit, but look something like this:

#include <Servo.h>


Servo myservo;  // create servo object to control a servo 

                // a maximum of eight servo objects can be created 

int pos = 0;    // variable to store the servo position 

int force_Pin0 = A0;   

int force_val0 = 0;

void setup() 

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

  Serial.begin(9600);

} 

void loop() {

  force_val0 = analogRead(force_Pin0);    // read the value from the photocell sensor, between 0 - 1024

  Serial.println(force_val0);         // print the total_lightval to Serial

  if (force_val0 > 0) {

    myservo.write(105);              // tell servo to go to position in variable 'pos' 

    delay(500);

  }    // waits 15ms for the servo to reach the position 

  if (force_val0 == 0) {                   

    myservo.write(160);              // tell servo to go to position in variable 'pos' 

    delay(500);

  }    // waits 15ms for the servo to reach the position   

  } 

 

OctoBeat
0
Your rating: None
Drupal theme by Kiwi Themes.