Spinning disk

61 views
Skip to first unread message

William Brown

unread,
Oct 5, 2023, 8:17:46 PM10/5/23
to MPF Users
How would I program a spinning disk to start and stop when a certain modes are activated?

Chris Sommerville

unread,
Oct 5, 2023, 10:14:59 PM10/5/23
to mpf-...@googlegroups.com
Put a stop mode in the config code for the modes that stop the disk counter/ score?

On Fri, 6 Oct 2023, 10:17 am William Brown, <billbr...@gmail.com> wrote:
How would I program a spinning disk to start and stop when a certain modes are activated?

--
You received this message because you are subscribed to the Google Groups "MPF Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mpf-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mpf-users/661d9980-cce7-4100-91b1-29d95529ba8cn%40googlegroups.com.

William Brown

unread,
Oct 5, 2023, 10:53:58 PM10/5/23
to MPF Users
I don't understand. How do I tell it to start spinning? Think like the spinning disks on whirlwind. It needs to spin while a mode is activated and stop when it is over. I haven't been able to find anything to suggest how to this type of device works. Which is a little surprising with how common they are.

Johan Gill

unread,
Oct 6, 2023, 12:48:38 AM10/6/23
to mpf-...@googlegroups.com
Hi.
I guess it's a motor that you just enable or disable, shouldn't be any different to anything else you turn on or off.

First decide how you are planning to hook it up.
What controller are you using? You could probably do it with a relay which you enable/disable. It all kinds depends. A bit more explanation exactly what you have and what you want to do would help.

But how to turn it on off when setup is like said before, use any of the players, usually event_player or in some instances the variable_player depending on your MPF -philosophy. :D

event_player: 
     mode_mymode_started: spin_disc
     mode_mymode_stopped: stop_disc

As example, but I would probably not do it with start and stop on mode but on my own custom event I can post at any time, I would probably even make the spinning disc as its own mode that's always running, but again, it depends on how you decide to design your game.

Cheers.

/Gill



William Brown

unread,
Oct 6, 2023, 9:12:57 AM10/6/23
to MPF Users
Yeah I understand how to use events, but how do I program the disk to actually spin?
Like when the event "spin_disc" happens what is telling the motor to turn on?
I see there is a motors section, but it requires position switches. 

Johan Gill

unread,
Oct 6, 2023, 9:48:23 AM10/6/23
to mpf-...@googlegroups.com
I would use a relay with the coil_player to enable/disable the motor, what controller are you using?

/Gill



William Brown

unread,
Oct 6, 2023, 9:59:42 AM10/6/23
to MPF Users
I've just been writing the code for now, but I plan on using CobraPin

Johan Gill

unread,
Oct 6, 2023, 10:18:26 AM10/6/23
to mpf-...@googlegroups.com
If using Cobra Pin you could use a relay with the coils section... This code below is taken straight from my own code to use with cobra, works great with my relays.

Example:
Coils:

    c_rc_relay_1: 
         number: 1-0-1 
         allow_enable: true 
         #disable_events:  
         #enable_events:  
     c_rc_relay_2: 
         number: 1-0-2 
         allow_enable: true
         #disable_events:  
         #enable_events:  

That the way I would go for , I'm a bit hesitant to use motors as a coil directly wired to the PCB but that for someone clever (not me) to answer.

/Gill


Reply all
Reply to author
Forward
0 new messages