I have built a system with 5 slotted switch sensors that are currently individually driving 5 LEDs. When none of the sensors are blocked, all 5 LEDs are on. As each sensor is sequentially blocked, the 5 LEDs turn off sequentially. What I am trying to do is to have 6 different images project on a computer screen depending on how many of the sensors are blocked.
If I connect each of the 5 sensors to PINS 1-5 (and for argument sake when the sensor is not blocked, it produces an analog value > 50 and when blocked the signal is <50), I think the following "logic" would accomplish what I want:
IF PIN 1>50 and
IF PIN 2>50 and
IF PIN 3>50 and
IF PIN 4>50 and
IF PIN 5>50 then display PHOTO1.JPG
IF PIN 1<50
IF PIN 2>50 and
IF PIN 3>50 and
IF PIN 4>50 and
IF PIN 5>50 then display PHOTO2.JPG
IF PIN 1<50,
IF PIN 2<50 and
IF PIN 3>50 and
IF PIN 4>50 and
IF PIN 5>50 then display PHOTO3.JPG
IF PIN 1<50
IF PIN 2<50 and
IF PIN 3<50 and
IF PIN 4>50 and
IF PIN 5>50 then display PHOTO4.JPG
IF PIN 1<50
IF PIN 2<50 and
IF PIN 3<50 and
IF PIN 4<50 and
IF PIN 5>50 then display PHOTO5.JPG
IF PIN 1<50 and
IF PIN 2<50 and
IF PIN 3<50 and
IF PIN 4<50 and
IF PIN 5<50 then display PHOTO6.JPG
I have played around with GoBetWino and should be able to open the 6 image files on my computer, but I need to get the Arduino sketch setup properly.
Should I use and if..else argument? Could someone point me in the right direction? Any help would be appreciated!
Thank you