(Topic ID: 335872)

LOTR Path of the Dead mode - ball detection in Orthanc VUC

By wbkwbk

12 months ago



Topic Stats

  • 2 posts
  • 1 Pinsider participating
  • Latest reply 11 months ago by wbkwbk
  • No one calls this topic a favorite

You

Linked Games

Topic Gallery

View topic image gallery

SwitchMatrix (resized).png
#1 12 months ago

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

SwitchMatrix (resized).pngSwitchMatrix (resized).png

1 week later
#2 11 months ago

SOLVED
The interrupt has to be attached to the column and inside the column the rowstate has to be read.
int MatrixColumn6Pin = 2;
int MatrixRow1Pin = 4;

attachInterrupt(digitalPinToInterrupt(MatrixColumn6Pin), InterruptRoutine, FALLING);

void InterruptRoutine(){

//Verzögerung der Abfrage, falls Arduino zu schnell sein sollte. Vermutlich nicht notwendig
//delayMicroseconds(1);

MatrixRow1Status = digitalRead(MatrixRow1Pin);
// Wenn Animation ohne Kugel ständig startet, auf LOW testen: if(MatrixRow1Status == LOW){
if(MatrixRow1Status == LOW){
Kugel = true;
#ifdef DEBUG
Serial.print("Kugel Boolean Wert In InterrupRoutine auf true gesetzt, Zeit:");
time();
Serial.print("\n");
#endif
TriggerZeit = millis();
}
}

Promoted items from Pinside Marketplace and Pinside Shops!
From: $ 10.00
Playfield - Protection
UpKick Pinball
 
10,000 (OBO)
Machine - For Sale
Deer Park, NY
From: $ 109.00
Playfield - Toys/Add-ons
PinWorlds
 
From: $ 185.00
Playfield - Toys/Add-ons
WilliPinball Mods
 
$ 120.00
Cabinet - Shooter Rods
Super Skill Shot Shop
 
From: $ 30.00
Playfield - Toys/Add-ons
RamMods
 
$ 12.00
Cabinet - Decals
Pinball Haus
 
$ 18.95
From: $ 99.99
Cabinet - Other
Lighted Pinball Mods
 
From: $ 33.00
Gameroom - Decorations
Rocket City Pinball
 
$ 30.00
Playfield - Other
YouBentMyWookie
 
$ 39.50
$ 12.95
9,000 (Firm)
Machine - For Sale
Ronkonkoma, NY
From: $ 99.00
Playfield - Toys/Add-ons
RGP Models
 
$ 50.00
Playfield - Protection
Duke Pinball
 
$ 200.00
Lighting - Interactive
Professor Pinball
 
10,400 (Firm)
Machine - For Sale
Juneau, WI
$ 259.99
Cabinet - Toppers
Lighted Pinball Mods
 
$ 41.00
Playfield - Toys/Add-ons
Lermods
 
$ 1.00
Pinball Machine
Pinball Alley
 
$ 99.99
Lighting - Other
Lighted Pinball Mods
 
$ 35.00
Cabinet - Decals
Pinball Haus
 
From: $ 9.99
$ 25.00
9,500
Machine - For Sale
Anderson, SC
$ 79.99
Cabinet - Armor And Blades
PinGraffix Pinside Shop
 
From: $ 218.00
Hey modders!
Your shop name here

Reply

Wanna join the discussion? Please sign in to reply to this topic.

Hey there! Welcome to Pinside!

Donate to Pinside

Great to see you're enjoying Pinside! Did you know Pinside is able to run without any 3rd-party banners or ads, thanks to the support from our visitors? Please consider a donation to Pinside and get anext to your username to show for it! Or better yet, subscribe to Pinside+!


This page was printed from https://pinside.com/pinball/forum/topic/lotr-path-of-the-dead-mode-ball-detection-in-orthanc-vuc and we tried optimising it for printing. Some page elements may have been deliberately hidden.

Scan the QR code on the left to jump to the URL this document was printed from.