Show Posts
Pages: [1]
1  Using Arduino / Project Guidance / Re: Talking Book Arduino/Processing on: April 16, 2013, 10:28:13 am
Yea, i would prefer to do that as well but its a class project and i have to use arduino/processing :/
2  Using Arduino / Project Guidance / Talking Book Arduino/Processing on: April 16, 2013, 04:02:58 am
Hey i'm new to, and frankly not that good with, either these programs and hitting a wall with an art project.

the project in a nutshell is that I'm making a physical book that when you open a page a prerecorded message plays and when you close it the sound turns off, i need this to happen for three different pages with three different recordings.

I need help in create a code that would have two buttons (that will later be translated into a physical circuits within the book) one that would play when released (when the book opens) and the second button which would turn off when pressed (When book closes)

I have the basic codes from here to start off from:
http://www.cla.purdue.edu/vpa/etb/resources/processing_and_arduino.pdf (Number 5 page 9)

i just need some guidance on how to reverse it and break it into two buttons

Also if i could get help on the actual circuit i'm trying to create (At the moment i'm thinking two copper strips with copper wire running from them to the breadboard to become a circuit) that would be awesome.

Thanks for taking the time to help out a newbie
3  Using Arduino / Audio / One sound for one Push Button (Processing to Arduino) on: April 09, 2013, 01:01:00 am
Hey, i'm working on a project that requires me to have sound play from processing when i am pressing down a button in Arduino and have it turn off and be silent when i take my finger off the button.

at the moment i can get the song to play when i'm holding the button down but when i'm not pressing it there is a loud noise in the background and i can't figure out how to fix it.

the answer might be simple and i'm just not experienced enough to see it but help would really be great, here's the code:


import processing.serial.*;

import cc.arduino.*;

import ddf.minim.*;
Minim minim;
AudioPlayer groove;
Arduino arduino;

int button = 2;



void setup()
{
  size(512, 200, P3D);
arduino = new Arduino(this, Arduino.list()[0], 57600);
  minim = new Minim(this);
  groove = minim.loadFile("marcus_kellis_theme.mp3");
  arduino.pinMode(button, Arduino.INPUT);
  background(0);
}


void draw()
{
 
  if (arduino.digitalRead(button) == Arduino.LOW )
  {
    groove.loop(1);
  }
  if (arduino.digitalRead(button) == Arduino.HIGH )
  {
    groove.play();
  } else {
  if (arduino.digitalRead(button) == Arduino.HIGH )
  {
    groove.pause();
  }
}
}
void stop()
{
  // always close Minim audio classes when you are done with them
  groove.close();
  // always stop Minim before exiting.
  minim.stop();
  super.stop();
}
Pages: [1]