Help with a project for an interactive Postbox Santa Claus

Hello,

I posted earlier, but I’m still very confused and can’t figure this out…
The idea is, when a childs post his/her letter for Santa in a box, I get a random number from a USB-Port, which goes from 1 to 5, which references to a movie with the same number (movie1, movie2,… etc). If the installation is inactive, Movie0 plays in loop
I’ve attached a picture to clearify my project with marked # numbers

1: So let’s say we start at an idle state, where movie0 (#5) plays in loop.
2: A letter is dropped in the box, picked up by the sensor and sends a random number to a serialCHOP (#1). Since I don’t have access to the USB because I work from home, a constant stands in for now (#2) with a manual index number
3: A constant (#3) then sends the index number to a switch (#9) to start the random corresponding movie (#6)
4: At the same moment it triggers a triggerChop (#4) which sends a reload pulse to all the random movies no matter which movie wil be played from the index number, but this is not really vital to the problem.
5: Now the chosen movie needs to send it’s length-data under (#7) to the timer (#8) so I can get a 0-value from the running state.
6: When the timer ends, the project should switch to the idle movie0 again, and it’s 0-value from the Timer should be fed into the switchCHOP index. But logically, it won’t allow me to do so, because the switch gets its feed from the serialCHOP.

Hopefully someone can help me to find a solution. This has been a braincracker for weeks now. I am a total TD- and Python noob, but I’m learning fast. Just not there yet for a long time.

Hi there,

There are different ways you could go about this, depending how much you want to optimize it. That depends on how big your movies are, and how much you need to store in memory on each movie call.

That being said, here a basic example that does what you want, with a bit of scripting.

Player.tox (21.3 KB)