Code:
if (1>50 && 2>50 && 3>50 && 4>50 && 5>50)
{
display photo1.jpg;
display photo2.jpg;
display photo3.jpg;
display photo4.jpg;
display photo5.jpg;
display photo6.jpg;
}
{
display photo1.jpg;
display photo2.jpg;
display photo3.jpg;
display photo4.jpg;
display photo5.jpg;
display photo6.jpg;
}
But i would advise assigning names to your pins because using the pin numbers gets to be frustration. In any case to get reading you have to call a function that does so.
Code:
const byte sensorOne = 1; // sensor one is connected to pin one
int sensorOneVal; // create variable to hold the incoming value
setup(){
pinMode(sensorOne, INPUT); // set pin one as an input
}
loop(){
sensorOneVal = analogRead(sensorOne); // read the value of sensor one and store it to sensorOneVal
if (sensorOneVal > 50) // see if the sensor value was above 50
{
display photo1.jpg // display the photo, whatever that means....
}
}
int sensorOneVal; // create variable to hold the incoming value
setup(){
pinMode(sensorOne, INPUT); // set pin one as an input
}
loop(){
sensorOneVal = analogRead(sensorOne); // read the value of sensor one and store it to sensorOneVal
if (sensorOneVal > 50) // see if the sensor value was above 50
{
display photo1.jpg // display the photo, whatever that means....
}
}
My advice, if you just read what i put in that code block and have no idea whats happening..... start here and read lots more!
