Show Posts
Pages: [1]
1  Using Arduino / Programming Questions / Re: Temporarily halting a sensor? (help) on: May 12, 2013, 11:19:26 am
Thanks for the pointers on the code. Yeah, I want sensor2 to stop triggering for about 3 minutes.
2  Using Arduino / Programming Questions / Temporarily halting a sensor? (help) on: May 12, 2013, 10:38:13 am
Hi, I'm not too sure if this is possible. However here is the suss, I've got 4 sensors, 3 of which are LDR's. I've installed them in an art installation i've built. Thing is its a small space that gives you commands via MP3 trigger which are triggered by the LDR sensors. There is one at the base which gives you a command to stand up. The problem is that when you stand up in the space, the sensor is still active, and does not seem to let other sensors trigger while it is active. I've tried a delay but I doesn't seem to work. I don't know what the problem is or how to solve it. Any help would be much appreciated as the show is tomorrow. Thanks.

Here is the code;

Code:
#include <MP3Trigger.h>
MP3Trigger trigger;



 
const int sensor1 = A0;
const int sensor2 = A1;
const int sensor3 = A2;
const int sensor4 = A3;
const int LED = 12;
const int LED2 = 13;
 
int value1 = 0;
int value2 = 0;
int value3 = 0;
int value4 = 0;


 
void setup()
{
  trigger.setup(&Serial);
  Serial.begin( MP3Trigger::serialRate() );

pinMode(LED, OUTPUT);
pinMode(LED2, OUTPUT);

}

 

void loop()

{
  digitalWrite(LED, HIGH);
  digitalWrite(LED2, HIGH);
  value1 = analogRead(sensor1); //SENSOR1
 
 if (value1 == 350)
 delay(10)
    {
 
     
         Serial.write('t');
         Serial.write(1);
       
       
    }     


  value2 = analogRead(sensor2); //SENSOR2
 
  if (value2 == 200)
  delay(10)
    {
 
       
     
         Serial.write('t');
         Serial.write(2);
         
       
       
    }   
   
  value3 = analogRead(sensor3); //SENSOR3
 
  if (value3 == 200)
  delay(10)
    {
 
       
     
         Serial.write('t');
         Serial.write(3);
         
         
       
    }


value4 = analogRead(sensor4); //SENSOR4
 
  if (value4 == 200)
  delay(10)
    {
 
       
     
         Serial.write('t');
         Serial.write(4);
         
         
         
       
    }   
}
3  Using Arduino / Programming Questions / MP3 Trigger V2 + Arduino Problem on: May 06, 2013, 11:40:02 am
I have an arduino uno hooked up via GND + TX to a sparkfun MP3 Trigger v2's GND + RX.

I have installed the Mp3 Trigger library and the code I have is as follows

Code:
#include <MP3Trigger.h>
MP3Trigger trigger;
 
const int sensor = A0;

 
int valueP = 0;
int buttonState = 0;

 
void setup()
{
  trigger.setup(&Serial);
  Serial.begin( MP3Trigger::serialRate() );
}
 

void loop()
{
  valueP = analogRead(sensor);
 
  if (valueP < 200)
    {
 
         
         
          trigger.trigger(1);
         
    }     
}

When the sensor value goes below 200 the TX light on the arduino turns on equally with the mp3 triggers light going off.

So I should be getting audio, but I'm not.

I dont know if the code for triggering track one is the right one or not ?

Any help would be much appreciated.
4  Using Arduino / Audio / MP3 Trigger V2 + Arduino Problem on: May 06, 2013, 11:38:30 am
I have an arduino uno hooked up via GND + TX to a sparkfun MP3 Trigger v2's GND + RX.

I have installed the Mp3 Trigger library and the code I have is as follows

Code:
#include <MP3Trigger.h>
MP3Trigger trigger;
 
const int sensor = A0;

 
int valueP = 0;
int buttonState = 0;

 
void setup()
{
  trigger.setup(&Serial);
  Serial.begin( MP3Trigger::serialRate() );
}
 

void loop()
{
  valueP = analogRead(sensor);
 
  if (valueP < 200)
    {
 
         
         
          trigger.trigger(1);
         
    }     
}

When the sensor value goes below 200 the TX light on the arduino turns on equally with the mp3 triggers light going off.

So I should be getting audio, but I'm not.

I dont know if the code for triggering track one is the right one or not ?

Any help would be much appreciated.
5  Using Arduino / Microcontrollers / Re: ATtiny 85 Problem on: April 29, 2013, 02:53:37 pm
Ah right cool. Thanks a lot for the help and information. I'll get on that right away, and see if it works.
6  Using Arduino / Microcontrollers / Re: ATtiny 85 Problem on: April 29, 2013, 02:14:11 pm
Yeah that didn't work either.

I was using a 8ohm 0.5W speaker.One wire to ground and one PB3
7  Using Arduino / Microcontrollers / Re: ATtiny 85 Problem on: April 29, 2013, 01:10:24 pm
I tried that just there, still the same problem, the speker just clicks on when i wire it up, but nothing else.a
8  Using Arduino / Microcontrollers / Re: ATtiny 85 Problem on: April 29, 2013, 12:00:50 pm
Code:
void setup() {
  // initialize serial communications (for debugging only):
  Serial.begin(9600);
}

void loop() {
  // read the sensor:
  int sensorReading = analogRead(A0);
  // print the sensor reading so you know its range
  Serial.println(sensorReading);
  // map the analog input range (in this case, 400 - 1000 from the photoresistor)
  // to the output pitch range (120 - 1500Hz)
  // change the minimum and maximum input numbers below
  // depending on the range your sensor's giving:
  int thisPitch = map(sensorReading, 400, 1000, 120, 1500);

  // play the pitch:
  tone(9, thisPitch, 10);
  delay(1);        // delay in between reads for stability
}

And with the corrections;

Code:
void loop() {
  // read the sensor:
  int sensorReading = analogRead(2);

  int thisPitch = map(sensorReading, 400, 1000, 120, 1500);

  // play the pitch:
  tone(3, thisPitch, 10);
  delay(1);        // delay in between reads for stability
}
9  Using Arduino / Microcontrollers / Re: ATtiny 85 Problem on: April 28, 2013, 03:51:45 pm
I'm using the arduino-tiny core from google code. It seems to recognize tone as a command but it doesnt seem to produce a tone. Haven't a breeze what the problem is.
10  Using Arduino / Microcontrollers / Re: ATtiny 85 Problem on: April 28, 2013, 02:10:04 pm
I numbered them correctly first, then tried them in different pins, then saw online someone number it this way and it was the only way it produced sound, but it is not changing the pitch.
11  Using Arduino / Microcontrollers / ATtiny 85 Problem on: April 28, 2013, 12:09:07 pm
Is there anyways of getting the tonePitchFollower example sketch to work on a ATtiny? I've stripped the code so it can be uploaded to the ATtiny. But it does not change the ptich it just clicks on and off. Does the ATtiny support the sketch? any help would be appreciated.

CODE;

void setup() {

}

void loop() {
  
  int sensorReading = analogRead(5);
  
  int thisPitch = map(sensorReading, 400, 1500, 120, 1500);

  
  tone(PB4, thisPitch, 10);
  delay(1);      
}
12  Using Arduino / Installation & Troubleshooting / Re: GND Pin Problem (help) on: April 24, 2013, 12:55:38 pm
Yeah i actually sorted it out there, I was using the arduino to program ATtiny chips and i had one of the wires the wrong way, rookie mistake. Thanks for that though.
13  Using Arduino / Installation & Troubleshooting / GND Pin Problem (help) on: April 24, 2013, 12:14:57 pm
I'm really new to arduino, but today when i turned arduino on, it seemed to be working fine, then when i connected the GND pin to the breadboard arduino just turns off, i tried this as well on an empty breadboard too, I really don't know what the problem is, any help would be so much appreciated.
14  Using Arduino / Audio / Using arduino to trigger sound (Need Help, Am Noob) on: April 20, 2013, 10:31:18 am
Hi,

 I'm a complete newbie to arduino and electronics in general. I'm working on an art installation for an end of year show and wanted to use IR sensors to trigger audio and play it through large speakers. I have an arduino uno r3, I've checked on the internet about various ways of doing thing ie, using a WTV020SD-16P Music Module and Sparkfun MP3 trigger. If I can get any information as to a simple method to achieve this, it would be much appreciated.

Forgive me if there is not enough information to warrant a response. I'm a tad inept at this sort of this, but am desperate to learn.

Thanks.
15  Using Arduino / Project Guidance / Triggering sound with arduino uno (need help) on: April 20, 2013, 09:16:05 am
Hi,

 I'm a complete newbie to arduino and electronics in general. I'm working on an art installation for an end of year show and wanted to use IR sensors to trigger audio and play it through large speakers. I have an arduino uno r3, I've checked on the internet about various ways of doing thing ie, using a WTV020SD-16P Music Module and Sparkfun MP3 trigger. If I can get any information as to a simple method to achieve this, it would be much appreciated.

Forgive me if there is not enough information to warrant a response. I'm a tad inept at this sort of this, but am desperate to learn.

Thanks.

Pages: [1]