Hi
I am just about to implement a path of the dead mode. I'd like to control 3 LEDs which I put into the figures with an Arduino nano. Therefore I want to detect when a ball enters the Orthanc VUC to start the LED animation.
Here are my code Fragments:
int OrthancPin = 2;
attachInterrupt(digitalPinToInterrupt(OrthancPin), KugelDetektiert, RISING);
void KugelDetektiert(){
Kugel = true;
}
void loop() {
// Wait for ball in Orthanc VUC
while(Kugel == false){
delay(500);
}
...
Start LED animation
Kugel=false
}
I've connected the Opto Receiver Board 515-7308-00 (520-5232) Pin J1-A with Arduino: D2
So far so good, the ball is detected when entering the Orthanc VUC
BUT all the other Switches in row 1 (same switch row as the Orthanc VUC) trigger the KugelDetektiert() as well.
Anyone have any idea how to solve the issue on dedecting the column as well? I've tried:
Adding a second connection frim Receiver Board 515-7308-00 (520-5232) Pin J1-B to Arduino: D4
And enhancing the script:
int SwitchMatrixPin = 4;
int RowState;
void KugelDetektiert(){
RowState = digitalRead(SwitchMatrixPin);
if(RowState == HIGH){
TriggerZeit = millis();
}
}
But this did not work at all - Orthanc VUC is not working anymore - only a ball search releases the ball again.
Any hints are very welcome
Many thanks
Martin