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;
#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);
}
}