EM Arrangeball conversion to Arduino
- mrmikeman
- MAACA Mega Contributor
- Posts: 3294
- Joined: Thu Nov 19, 2009 9:31 am
- Location: Ottawa, ON
- Has liked: 105 times
- Been liked: 268 times
EM Arrangeball conversion to Arduino
So Arrangeball is a Pachinko style gambling game. Pays out coins. Plays like a bingo machine where you make lines/squares/etc to win credits.
It'll be done in 2 phases:
- Hardware conversion
- Programming
I've started by removing all the hardware that I no longer need. I'm not a fan of cutting harnesses or breaking things so I've kept all the original harnesses/hardware intact but removed from the machine.
Installed a PS for 5, 12, and 24V:
- 5V is to power the relays (for the solenoids).
- 12V to power the addressable RBG lights as well as the Arduino Mega.
- 24V to power the solenoids.
I got the metal case with easy connection shield for the Mega. Makes things clean and solid.
Progress so far:
- Light boards removed.
- Ball switches removed (15).
- Ultrasonic cleaned the metal switch holder.
- PS is installed as well as 1 relay for the payout solenoid. Will rewire the solenoids like a pinball. Power to the coil and ground for the trigger. My relay is reversed right now (controls 24V instead of GND).
- Started testing the light control with test programs. Haven't decided which library to use yet. Will likely use WS2812FX. Right now all works ok with FASTLED but the other library has built-in animations that I can use for the attract mode.
It'll be done in 2 phases:
- Hardware conversion
- Programming
I've started by removing all the hardware that I no longer need. I'm not a fan of cutting harnesses or breaking things so I've kept all the original harnesses/hardware intact but removed from the machine.
Installed a PS for 5, 12, and 24V:
- 5V is to power the relays (for the solenoids).
- 12V to power the addressable RBG lights as well as the Arduino Mega.
- 24V to power the solenoids.
I got the metal case with easy connection shield for the Mega. Makes things clean and solid.
Progress so far:
- Light boards removed.
- Ball switches removed (15).
- Ultrasonic cleaned the metal switch holder.
- PS is installed as well as 1 relay for the payout solenoid. Will rewire the solenoids like a pinball. Power to the coil and ground for the trigger. My relay is reversed right now (controls 24V instead of GND).
- Started testing the light control with test programs. Haven't decided which library to use yet. Will likely use WS2812FX. Right now all works ok with FASTLED but the other library has built-in animations that I can use for the attract mode.
PINS:
Labyrinth (#21)
Jurassic Park LE (#449)
JAWS Premium
Scooby Doo CE (#141)
Looney Tunes CE (#086)
MultiMorphic P3 with all modules except Lexy Lightspeed
Star Wars Prem
Star Trek the Next Generation
JUKES
Seeburg STD2 Entertainer - Converted to MP3 while retaining the original look and feel. *FOR SALE - $500
NSM Emerald Ice CD(100) wall hanger juke. *FOR SALE - $1400
Gone but not forgotten
So many... Lexy Lightspeed, Recel Lady Luck, Gtb Pro-Football, CCrLE, WOZ ECLE, Stern POTC, Star Trek Pro, MMrRE, Stranger Things LE, Dr Who, RFM, SWEP1, Road Show, Monster Bash, Twilight Zone, Lord of the Rings, Simpsons Pinball Party, Demolition Man, Terminator 2, Funhouse, Tales from the Crypt, High Speed, Bad Cats, Flintstones, WWF Royal Rumble, Laser War, Laser Ball, Silver Slugger, Batman Forever, Pinbot, 6 Million Dollar Man, Galaxy, Meteor, Countdown, Hot Tip(SS), and others I just can't think of lol.
Labyrinth (#21)
Jurassic Park LE (#449)
JAWS Premium
Scooby Doo CE (#141)
Looney Tunes CE (#086)
MultiMorphic P3 with all modules except Lexy Lightspeed
Star Wars Prem
Star Trek the Next Generation
JUKES
Seeburg STD2 Entertainer - Converted to MP3 while retaining the original look and feel. *FOR SALE - $500
NSM Emerald Ice CD(100) wall hanger juke. *FOR SALE - $1400
Gone but not forgotten
So many... Lexy Lightspeed, Recel Lady Luck, Gtb Pro-Football, CCrLE, WOZ ECLE, Stern POTC, Star Trek Pro, MMrRE, Stranger Things LE, Dr Who, RFM, SWEP1, Road Show, Monster Bash, Twilight Zone, Lord of the Rings, Simpsons Pinball Party, Demolition Man, Terminator 2, Funhouse, Tales from the Crypt, High Speed, Bad Cats, Flintstones, WWF Royal Rumble, Laser War, Laser Ball, Silver Slugger, Batman Forever, Pinbot, 6 Million Dollar Man, Galaxy, Meteor, Countdown, Hot Tip(SS), and others I just can't think of lol.
- semicolin
- MAACA Mega Contributor
- Posts: 1221
- Joined: Sun Apr 17, 2016 4:32 pm
- Location: Ottawa, ON
- Has liked: 189 times
- Been liked: 245 times
- Contact:
Re: EM Arrangeball conversion to Arduino
What are you gonna do for sound? Fire some solenoids at a chime box or trigger an audio board?
Sharing my space with: Meteor, Tag Team, Dragon, Centaur II, Middle Earth, Xenon, Dolly Parton, Mata Hari, Star Trip, Street Fighter cab w/Premium 8
- mrmikeman
- MAACA Mega Contributor
- Posts: 3294
- Joined: Thu Nov 19, 2009 9:31 am
- Location: Ottawa, ON
- Has liked: 105 times
- Been liked: 268 times
Re: EM Arrangeball conversion to Arduino
There's no sound in these things. Don't plan on changing that. I want to keep the old school charm.
PINS:
Labyrinth (#21)
Jurassic Park LE (#449)
JAWS Premium
Scooby Doo CE (#141)
Looney Tunes CE (#086)
MultiMorphic P3 with all modules except Lexy Lightspeed
Star Wars Prem
Star Trek the Next Generation
JUKES
Seeburg STD2 Entertainer - Converted to MP3 while retaining the original look and feel. *FOR SALE - $500
NSM Emerald Ice CD(100) wall hanger juke. *FOR SALE - $1400
Gone but not forgotten
So many... Lexy Lightspeed, Recel Lady Luck, Gtb Pro-Football, CCrLE, WOZ ECLE, Stern POTC, Star Trek Pro, MMrRE, Stranger Things LE, Dr Who, RFM, SWEP1, Road Show, Monster Bash, Twilight Zone, Lord of the Rings, Simpsons Pinball Party, Demolition Man, Terminator 2, Funhouse, Tales from the Crypt, High Speed, Bad Cats, Flintstones, WWF Royal Rumble, Laser War, Laser Ball, Silver Slugger, Batman Forever, Pinbot, 6 Million Dollar Man, Galaxy, Meteor, Countdown, Hot Tip(SS), and others I just can't think of lol.
Labyrinth (#21)
Jurassic Park LE (#449)
JAWS Premium
Scooby Doo CE (#141)
Looney Tunes CE (#086)
MultiMorphic P3 with all modules except Lexy Lightspeed
Star Wars Prem
Star Trek the Next Generation
JUKES
Seeburg STD2 Entertainer - Converted to MP3 while retaining the original look and feel. *FOR SALE - $500
NSM Emerald Ice CD(100) wall hanger juke. *FOR SALE - $1400
Gone but not forgotten
So many... Lexy Lightspeed, Recel Lady Luck, Gtb Pro-Football, CCrLE, WOZ ECLE, Stern POTC, Star Trek Pro, MMrRE, Stranger Things LE, Dr Who, RFM, SWEP1, Road Show, Monster Bash, Twilight Zone, Lord of the Rings, Simpsons Pinball Party, Demolition Man, Terminator 2, Funhouse, Tales from the Crypt, High Speed, Bad Cats, Flintstones, WWF Royal Rumble, Laser War, Laser Ball, Silver Slugger, Batman Forever, Pinbot, 6 Million Dollar Man, Galaxy, Meteor, Countdown, Hot Tip(SS), and others I just can't think of lol.
- semicolin
- MAACA Mega Contributor
- Posts: 1221
- Joined: Sun Apr 17, 2016 4:32 pm
- Location: Ottawa, ON
- Has liked: 189 times
- Been liked: 245 times
- Contact:
Re: EM Arrangeball conversion to Arduino
Not to disagree, but all the rules went out the window when you wrote down the words "addressable RGB lights!"
Sharing my space with: Meteor, Tag Team, Dragon, Centaur II, Middle Earth, Xenon, Dolly Parton, Mata Hari, Star Trip, Street Fighter cab w/Premium 8
- mrmikeman
- MAACA Mega Contributor
- Posts: 3294
- Joined: Thu Nov 19, 2009 9:31 am
- Location: Ottawa, ON
- Has liked: 105 times
- Been liked: 268 times
Re: EM Arrangeball conversion to Arduino
It’s easier using addressable bulbs than managing 26 individual bulb circuits. I *may* use color or I may just use white. I plan to just go white to start, get the software/game running 100%, then I’ll consider prettying things up with colors/attract mode lol.
Today I came up with a way to mound the RGB bulbs.
Today I came up with a way to mound the RGB bulbs.
Last edited by mrmikeman on Sat Feb 01, 2025 4:07 pm, edited 1 time in total.
PINS:
Labyrinth (#21)
Jurassic Park LE (#449)
JAWS Premium
Scooby Doo CE (#141)
Looney Tunes CE (#086)
MultiMorphic P3 with all modules except Lexy Lightspeed
Star Wars Prem
Star Trek the Next Generation
JUKES
Seeburg STD2 Entertainer - Converted to MP3 while retaining the original look and feel. *FOR SALE - $500
NSM Emerald Ice CD(100) wall hanger juke. *FOR SALE - $1400
Gone but not forgotten
So many... Lexy Lightspeed, Recel Lady Luck, Gtb Pro-Football, CCrLE, WOZ ECLE, Stern POTC, Star Trek Pro, MMrRE, Stranger Things LE, Dr Who, RFM, SWEP1, Road Show, Monster Bash, Twilight Zone, Lord of the Rings, Simpsons Pinball Party, Demolition Man, Terminator 2, Funhouse, Tales from the Crypt, High Speed, Bad Cats, Flintstones, WWF Royal Rumble, Laser War, Laser Ball, Silver Slugger, Batman Forever, Pinbot, 6 Million Dollar Man, Galaxy, Meteor, Countdown, Hot Tip(SS), and others I just can't think of lol.
Labyrinth (#21)
Jurassic Park LE (#449)
JAWS Premium
Scooby Doo CE (#141)
Looney Tunes CE (#086)
MultiMorphic P3 with all modules except Lexy Lightspeed
Star Wars Prem
Star Trek the Next Generation
JUKES
Seeburg STD2 Entertainer - Converted to MP3 while retaining the original look and feel. *FOR SALE - $500
NSM Emerald Ice CD(100) wall hanger juke. *FOR SALE - $1400
Gone but not forgotten
So many... Lexy Lightspeed, Recel Lady Luck, Gtb Pro-Football, CCrLE, WOZ ECLE, Stern POTC, Star Trek Pro, MMrRE, Stranger Things LE, Dr Who, RFM, SWEP1, Road Show, Monster Bash, Twilight Zone, Lord of the Rings, Simpsons Pinball Party, Demolition Man, Terminator 2, Funhouse, Tales from the Crypt, High Speed, Bad Cats, Flintstones, WWF Royal Rumble, Laser War, Laser Ball, Silver Slugger, Batman Forever, Pinbot, 6 Million Dollar Man, Galaxy, Meteor, Countdown, Hot Tip(SS), and others I just can't think of lol.
- mrmikeman
- MAACA Mega Contributor
- Posts: 3294
- Joined: Thu Nov 19, 2009 9:31 am
- Location: Ottawa, ON
- Has liked: 105 times
- Been liked: 268 times
Re: EM Arrangeball conversion to Arduino
It’s thin plastic that’s cuttable with scissors but stiff enough to hold the bulbs.
PINS:
Labyrinth (#21)
Jurassic Park LE (#449)
JAWS Premium
Scooby Doo CE (#141)
Looney Tunes CE (#086)
MultiMorphic P3 with all modules except Lexy Lightspeed
Star Wars Prem
Star Trek the Next Generation
JUKES
Seeburg STD2 Entertainer - Converted to MP3 while retaining the original look and feel. *FOR SALE - $500
NSM Emerald Ice CD(100) wall hanger juke. *FOR SALE - $1400
Gone but not forgotten
So many... Lexy Lightspeed, Recel Lady Luck, Gtb Pro-Football, CCrLE, WOZ ECLE, Stern POTC, Star Trek Pro, MMrRE, Stranger Things LE, Dr Who, RFM, SWEP1, Road Show, Monster Bash, Twilight Zone, Lord of the Rings, Simpsons Pinball Party, Demolition Man, Terminator 2, Funhouse, Tales from the Crypt, High Speed, Bad Cats, Flintstones, WWF Royal Rumble, Laser War, Laser Ball, Silver Slugger, Batman Forever, Pinbot, 6 Million Dollar Man, Galaxy, Meteor, Countdown, Hot Tip(SS), and others I just can't think of lol.
Labyrinth (#21)
Jurassic Park LE (#449)
JAWS Premium
Scooby Doo CE (#141)
Looney Tunes CE (#086)
MultiMorphic P3 with all modules except Lexy Lightspeed
Star Wars Prem
Star Trek the Next Generation
JUKES
Seeburg STD2 Entertainer - Converted to MP3 while retaining the original look and feel. *FOR SALE - $500
NSM Emerald Ice CD(100) wall hanger juke. *FOR SALE - $1400
Gone but not forgotten
So many... Lexy Lightspeed, Recel Lady Luck, Gtb Pro-Football, CCrLE, WOZ ECLE, Stern POTC, Star Trek Pro, MMrRE, Stranger Things LE, Dr Who, RFM, SWEP1, Road Show, Monster Bash, Twilight Zone, Lord of the Rings, Simpsons Pinball Party, Demolition Man, Terminator 2, Funhouse, Tales from the Crypt, High Speed, Bad Cats, Flintstones, WWF Royal Rumble, Laser War, Laser Ball, Silver Slugger, Batman Forever, Pinbot, 6 Million Dollar Man, Galaxy, Meteor, Countdown, Hot Tip(SS), and others I just can't think of lol.
- mrmikeman
- MAACA Mega Contributor
- Posts: 3294
- Joined: Thu Nov 19, 2009 9:31 am
- Location: Ottawa, ON
- Has liked: 105 times
- Been liked: 268 times
Re: EM Arrangeball conversion to Arduino
Switches, coils, and relays all wired into the arduino now. I only need to complete 2 splices on the light sting. I had to cut it in 2 places to install.
PINS:
Labyrinth (#21)
Jurassic Park LE (#449)
JAWS Premium
Scooby Doo CE (#141)
Looney Tunes CE (#086)
MultiMorphic P3 with all modules except Lexy Lightspeed
Star Wars Prem
Star Trek the Next Generation
JUKES
Seeburg STD2 Entertainer - Converted to MP3 while retaining the original look and feel. *FOR SALE - $500
NSM Emerald Ice CD(100) wall hanger juke. *FOR SALE - $1400
Gone but not forgotten
So many... Lexy Lightspeed, Recel Lady Luck, Gtb Pro-Football, CCrLE, WOZ ECLE, Stern POTC, Star Trek Pro, MMrRE, Stranger Things LE, Dr Who, RFM, SWEP1, Road Show, Monster Bash, Twilight Zone, Lord of the Rings, Simpsons Pinball Party, Demolition Man, Terminator 2, Funhouse, Tales from the Crypt, High Speed, Bad Cats, Flintstones, WWF Royal Rumble, Laser War, Laser Ball, Silver Slugger, Batman Forever, Pinbot, 6 Million Dollar Man, Galaxy, Meteor, Countdown, Hot Tip(SS), and others I just can't think of lol.
Labyrinth (#21)
Jurassic Park LE (#449)
JAWS Premium
Scooby Doo CE (#141)
Looney Tunes CE (#086)
MultiMorphic P3 with all modules except Lexy Lightspeed
Star Wars Prem
Star Trek the Next Generation
JUKES
Seeburg STD2 Entertainer - Converted to MP3 while retaining the original look and feel. *FOR SALE - $500
NSM Emerald Ice CD(100) wall hanger juke. *FOR SALE - $1400
Gone but not forgotten
So many... Lexy Lightspeed, Recel Lady Luck, Gtb Pro-Football, CCrLE, WOZ ECLE, Stern POTC, Star Trek Pro, MMrRE, Stranger Things LE, Dr Who, RFM, SWEP1, Road Show, Monster Bash, Twilight Zone, Lord of the Rings, Simpsons Pinball Party, Demolition Man, Terminator 2, Funhouse, Tales from the Crypt, High Speed, Bad Cats, Flintstones, WWF Royal Rumble, Laser War, Laser Ball, Silver Slugger, Batman Forever, Pinbot, 6 Million Dollar Man, Galaxy, Meteor, Countdown, Hot Tip(SS), and others I just can't think of lol.
- mrmikeman
- MAACA Mega Contributor
- Posts: 3294
- Joined: Thu Nov 19, 2009 9:31 am
- Location: Ottawa, ON
- Has liked: 105 times
- Been liked: 268 times
Re: EM Arrangeball conversion to Arduino
Progress!
Wiring completed. Light string tested and correct insert numbers assigned to the string. Switch scan now light appropriate insert for ball switches. Instant 1-credit payout switch also pays out 1 coin.
Game/payout logic will take a bit longer to program.
Wiring completed. Light string tested and correct insert numbers assigned to the string. Switch scan now light appropriate insert for ball switches. Instant 1-credit payout switch also pays out 1 coin.
Game/payout logic will take a bit longer to program.
PINS:
Labyrinth (#21)
Jurassic Park LE (#449)
JAWS Premium
Scooby Doo CE (#141)
Looney Tunes CE (#086)
MultiMorphic P3 with all modules except Lexy Lightspeed
Star Wars Prem
Star Trek the Next Generation
JUKES
Seeburg STD2 Entertainer - Converted to MP3 while retaining the original look and feel. *FOR SALE - $500
NSM Emerald Ice CD(100) wall hanger juke. *FOR SALE - $1400
Gone but not forgotten
So many... Lexy Lightspeed, Recel Lady Luck, Gtb Pro-Football, CCrLE, WOZ ECLE, Stern POTC, Star Trek Pro, MMrRE, Stranger Things LE, Dr Who, RFM, SWEP1, Road Show, Monster Bash, Twilight Zone, Lord of the Rings, Simpsons Pinball Party, Demolition Man, Terminator 2, Funhouse, Tales from the Crypt, High Speed, Bad Cats, Flintstones, WWF Royal Rumble, Laser War, Laser Ball, Silver Slugger, Batman Forever, Pinbot, 6 Million Dollar Man, Galaxy, Meteor, Countdown, Hot Tip(SS), and others I just can't think of lol.
Labyrinth (#21)
Jurassic Park LE (#449)
JAWS Premium
Scooby Doo CE (#141)
Looney Tunes CE (#086)
MultiMorphic P3 with all modules except Lexy Lightspeed
Star Wars Prem
Star Trek the Next Generation
JUKES
Seeburg STD2 Entertainer - Converted to MP3 while retaining the original look and feel. *FOR SALE - $500
NSM Emerald Ice CD(100) wall hanger juke. *FOR SALE - $1400
Gone but not forgotten
So many... Lexy Lightspeed, Recel Lady Luck, Gtb Pro-Football, CCrLE, WOZ ECLE, Stern POTC, Star Trek Pro, MMrRE, Stranger Things LE, Dr Who, RFM, SWEP1, Road Show, Monster Bash, Twilight Zone, Lord of the Rings, Simpsons Pinball Party, Demolition Man, Terminator 2, Funhouse, Tales from the Crypt, High Speed, Bad Cats, Flintstones, WWF Royal Rumble, Laser War, Laser Ball, Silver Slugger, Batman Forever, Pinbot, 6 Million Dollar Man, Galaxy, Meteor, Countdown, Hot Tip(SS), and others I just can't think of lol.
- mrmikeman
- MAACA Mega Contributor
- Posts: 3294
- Joined: Thu Nov 19, 2009 9:31 am
- Location: Ottawa, ON
- Has liked: 105 times
- Been liked: 268 times
Re: EM Arrangeball conversion to Arduino
Pics of tonight’s progress.
PINS:
Labyrinth (#21)
Jurassic Park LE (#449)
JAWS Premium
Scooby Doo CE (#141)
Looney Tunes CE (#086)
MultiMorphic P3 with all modules except Lexy Lightspeed
Star Wars Prem
Star Trek the Next Generation
JUKES
Seeburg STD2 Entertainer - Converted to MP3 while retaining the original look and feel. *FOR SALE - $500
NSM Emerald Ice CD(100) wall hanger juke. *FOR SALE - $1400
Gone but not forgotten
So many... Lexy Lightspeed, Recel Lady Luck, Gtb Pro-Football, CCrLE, WOZ ECLE, Stern POTC, Star Trek Pro, MMrRE, Stranger Things LE, Dr Who, RFM, SWEP1, Road Show, Monster Bash, Twilight Zone, Lord of the Rings, Simpsons Pinball Party, Demolition Man, Terminator 2, Funhouse, Tales from the Crypt, High Speed, Bad Cats, Flintstones, WWF Royal Rumble, Laser War, Laser Ball, Silver Slugger, Batman Forever, Pinbot, 6 Million Dollar Man, Galaxy, Meteor, Countdown, Hot Tip(SS), and others I just can't think of lol.
Labyrinth (#21)
Jurassic Park LE (#449)
JAWS Premium
Scooby Doo CE (#141)
Looney Tunes CE (#086)
MultiMorphic P3 with all modules except Lexy Lightspeed
Star Wars Prem
Star Trek the Next Generation
JUKES
Seeburg STD2 Entertainer - Converted to MP3 while retaining the original look and feel. *FOR SALE - $500
NSM Emerald Ice CD(100) wall hanger juke. *FOR SALE - $1400
Gone but not forgotten
So many... Lexy Lightspeed, Recel Lady Luck, Gtb Pro-Football, CCrLE, WOZ ECLE, Stern POTC, Star Trek Pro, MMrRE, Stranger Things LE, Dr Who, RFM, SWEP1, Road Show, Monster Bash, Twilight Zone, Lord of the Rings, Simpsons Pinball Party, Demolition Man, Terminator 2, Funhouse, Tales from the Crypt, High Speed, Bad Cats, Flintstones, WWF Royal Rumble, Laser War, Laser Ball, Silver Slugger, Batman Forever, Pinbot, 6 Million Dollar Man, Galaxy, Meteor, Countdown, Hot Tip(SS), and others I just can't think of lol.
- cait001
- MAACA Mega Contributor
- Posts: 4990
- Joined: Tue Oct 09, 2012 3:42 pm
- Location: Centretown, Ottawa, ON
- Has liked: 594 times
- Been liked: 294 times
Re: EM Arrangeball conversion to Arduino
following!
backglasses wanted: Star-Jet, Fairy, Star Trek (1971 Gottlieb)
marquees wanted: Roller Aces, Quiz Dragon, Strider, Varkon, Dark Planet, R-Type (w/ship), Quantum, Ninja (Sega)
blog -- collection -- want list -- Pinball Women Ottawa -- Ottawa Pinball Map -- ratings
marquees wanted: Roller Aces, Quiz Dragon, Strider, Varkon, Dark Planet, R-Type (w/ship), Quantum, Ninja (Sega)
blog -- collection -- want list -- Pinball Women Ottawa -- Ottawa Pinball Map -- ratings
- mrmikeman
- MAACA Mega Contributor
- Posts: 3294
- Joined: Thu Nov 19, 2009 9:31 am
- Location: Ottawa, ON
- Has liked: 105 times
- Been liked: 268 times
Re: EM Arrangeball conversion to Arduino
Basic programming is done. Game is working as it did originally. I haven’t put a payout limit however - original was 10 I believe. I want all the money lol.
I need to investigate on electrical noise reduction. The RGB strip (12v) is causing interference with a switch when lights close to that switch come on. It sucks because that’s the instant 1-coin payout switch. Switch/coil triggers randomly once the 3 lower RGB lights are on (5-8-15). The built-in pull-up resistors on the Mega are weak and the wires are a bit long. Bad combination. I may just need to add external pull-up resistors.
Other than that I have a fully working Arrangeball!
Once I fix the interference I will look into programming some light effects.
https://youtube.com/shorts/pVMla_PxZhE?feature=share
I need to investigate on electrical noise reduction. The RGB strip (12v) is causing interference with a switch when lights close to that switch come on. It sucks because that’s the instant 1-coin payout switch. Switch/coil triggers randomly once the 3 lower RGB lights are on (5-8-15). The built-in pull-up resistors on the Mega are weak and the wires are a bit long. Bad combination. I may just need to add external pull-up resistors.
Other than that I have a fully working Arrangeball!
Once I fix the interference I will look into programming some light effects.
https://youtube.com/shorts/pVMla_PxZhE?feature=share
PINS:
Labyrinth (#21)
Jurassic Park LE (#449)
JAWS Premium
Scooby Doo CE (#141)
Looney Tunes CE (#086)
MultiMorphic P3 with all modules except Lexy Lightspeed
Star Wars Prem
Star Trek the Next Generation
JUKES
Seeburg STD2 Entertainer - Converted to MP3 while retaining the original look and feel. *FOR SALE - $500
NSM Emerald Ice CD(100) wall hanger juke. *FOR SALE - $1400
Gone but not forgotten
So many... Lexy Lightspeed, Recel Lady Luck, Gtb Pro-Football, CCrLE, WOZ ECLE, Stern POTC, Star Trek Pro, MMrRE, Stranger Things LE, Dr Who, RFM, SWEP1, Road Show, Monster Bash, Twilight Zone, Lord of the Rings, Simpsons Pinball Party, Demolition Man, Terminator 2, Funhouse, Tales from the Crypt, High Speed, Bad Cats, Flintstones, WWF Royal Rumble, Laser War, Laser Ball, Silver Slugger, Batman Forever, Pinbot, 6 Million Dollar Man, Galaxy, Meteor, Countdown, Hot Tip(SS), and others I just can't think of lol.
Labyrinth (#21)
Jurassic Park LE (#449)
JAWS Premium
Scooby Doo CE (#141)
Looney Tunes CE (#086)
MultiMorphic P3 with all modules except Lexy Lightspeed
Star Wars Prem
Star Trek the Next Generation
JUKES
Seeburg STD2 Entertainer - Converted to MP3 while retaining the original look and feel. *FOR SALE - $500
NSM Emerald Ice CD(100) wall hanger juke. *FOR SALE - $1400
Gone but not forgotten
So many... Lexy Lightspeed, Recel Lady Luck, Gtb Pro-Football, CCrLE, WOZ ECLE, Stern POTC, Star Trek Pro, MMrRE, Stranger Things LE, Dr Who, RFM, SWEP1, Road Show, Monster Bash, Twilight Zone, Lord of the Rings, Simpsons Pinball Party, Demolition Man, Terminator 2, Funhouse, Tales from the Crypt, High Speed, Bad Cats, Flintstones, WWF Royal Rumble, Laser War, Laser Ball, Silver Slugger, Batman Forever, Pinbot, 6 Million Dollar Man, Galaxy, Meteor, Countdown, Hot Tip(SS), and others I just can't think of lol.
- mrmikeman
- MAACA Mega Contributor
- Posts: 3294
- Joined: Thu Nov 19, 2009 9:31 am
- Location: Ottawa, ON
- Has liked: 105 times
- Been liked: 268 times
Re: EM Arrangeball conversion to Arduino
And I wasn’t happy with my code structure and condensed things. I managed to shrink the win analysis section from 45-50 lines of code to 8. Woot!
PINS:
Labyrinth (#21)
Jurassic Park LE (#449)
JAWS Premium
Scooby Doo CE (#141)
Looney Tunes CE (#086)
MultiMorphic P3 with all modules except Lexy Lightspeed
Star Wars Prem
Star Trek the Next Generation
JUKES
Seeburg STD2 Entertainer - Converted to MP3 while retaining the original look and feel. *FOR SALE - $500
NSM Emerald Ice CD(100) wall hanger juke. *FOR SALE - $1400
Gone but not forgotten
So many... Lexy Lightspeed, Recel Lady Luck, Gtb Pro-Football, CCrLE, WOZ ECLE, Stern POTC, Star Trek Pro, MMrRE, Stranger Things LE, Dr Who, RFM, SWEP1, Road Show, Monster Bash, Twilight Zone, Lord of the Rings, Simpsons Pinball Party, Demolition Man, Terminator 2, Funhouse, Tales from the Crypt, High Speed, Bad Cats, Flintstones, WWF Royal Rumble, Laser War, Laser Ball, Silver Slugger, Batman Forever, Pinbot, 6 Million Dollar Man, Galaxy, Meteor, Countdown, Hot Tip(SS), and others I just can't think of lol.
Labyrinth (#21)
Jurassic Park LE (#449)
JAWS Premium
Scooby Doo CE (#141)
Looney Tunes CE (#086)
MultiMorphic P3 with all modules except Lexy Lightspeed
Star Wars Prem
Star Trek the Next Generation
JUKES
Seeburg STD2 Entertainer - Converted to MP3 while retaining the original look and feel. *FOR SALE - $500
NSM Emerald Ice CD(100) wall hanger juke. *FOR SALE - $1400
Gone but not forgotten
So many... Lexy Lightspeed, Recel Lady Luck, Gtb Pro-Football, CCrLE, WOZ ECLE, Stern POTC, Star Trek Pro, MMrRE, Stranger Things LE, Dr Who, RFM, SWEP1, Road Show, Monster Bash, Twilight Zone, Lord of the Rings, Simpsons Pinball Party, Demolition Man, Terminator 2, Funhouse, Tales from the Crypt, High Speed, Bad Cats, Flintstones, WWF Royal Rumble, Laser War, Laser Ball, Silver Slugger, Batman Forever, Pinbot, 6 Million Dollar Man, Galaxy, Meteor, Countdown, Hot Tip(SS), and others I just can't think of lol.
- mrmikeman
- MAACA Mega Contributor
- Posts: 3294
- Joined: Thu Nov 19, 2009 9:31 am
- Location: Ottawa, ON
- Has liked: 105 times
- Been liked: 268 times
Re: EM Arrangeball conversion to Arduino
Although I haven't fully optimized the code I don't really care right now as it works well. I don't use AI for this so I'm sure it could be a bit more condensed but I enjoy the mental challenge of figuring things out on my own. Here's what the code looks like right now:
Code: Select all
#include <FastLED.h>
// How many leds in the light strip?
#define NUM_LEDS 26
#define DATA_PIN 12
// Establish the array of leds
CRGB leds[NUM_LEDS];
// I use Intergers throughout but many of these could have been set as constants
// Define position of LED on string for playfield inserts 1 through 15. For example the insert with the #1 is the 11th RGB light on the string
int insert[] = {11, 5, 6, 9, 1, 14, 7, 2, 12, 4, 8, 10, 13, 15, 3};
// Define position of LED on light string to indicate a winning line. These are in order so it didn't really matter as much
int wininsert[10] = {16, 17, 18, 19, 20, 21, 22, 23, 24, 25};
// Define payout array. This keeps track of how many coins get paid out per winning line
int win[] = {1, 1, 1, 1, 1, 3, 2, 2, 2, 2};
// Define win lines in groups of 4. 1 line pays with only 3 balls so 1 switch was listed twice for that group - first 4 (5, 8, 8, and 15)
int winline[] = {5, 8, 8, 15, 3, 6, 9, 12, 2, 4, 7, 13, 1, 7, 10, 12, 4, 9, 11, 14, 4, 7, 9, 12, 4, 6, 12, 14, 7, 9, 11, 13, 1, 3, 7, 9, 2, 4, 10, 12};
// Define win lines
int lines[10];
// Define ball aray to track which switches have been activated
int ball[16];
// Define input pins for ball switches
int ballswitch[] = {31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45};
int instantpay = 46;
int coin = 30;
int quit = 29;
// Define output pins for both coils
int ballrelease = 52;
int coinpay = 53;
// Define gameplay flags for play active and winning lines
bool pay = false;
bool gameover = true;
// Define prototype functions - doesn't do anything other than let the program know these exist after the "LOOP" section
void payout();
void reset();
// Initialize process
void setup() {
// Setup addressable RGB light string
FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);
// Assign arduino pins 29-46 for switches. 29-Quit(payout). 30-Coin in. 31-45 are ball switches. 46 - Instant payout LUCKY 7
for (int i = 28; i < 46; i++) pinMode(i, INPUT_PULLUP);
// Assign mode and pin number to the ball release coil
pinMode(ballrelease, OUTPUT);
// Assign mode and pin number to the payout coil
pinMode(coinpay, OUTPUT);
// Light GAME OVER light
leds[0] = CRGB::Red;
FastLED.show();
}
void loop() {
// If gameover is true loop will only scan for coin added - this is where I may add an attract mode (light animations)
if (gameover == true) {
if (digitalRead(coin) == LOW) reset();
}
// Game is in play - scan for coin/quit which payout as required and then restart a game if it was coin. Scan also for lucky 7 which pays out instantly a coin
else if (gameover == false) {
if (digitalRead(coin) == LOW){
if (pay == true) payout()
reset();
}
if (digitalRead(quit) == LOW){
if (pay == true) payout();
gameover = true;
leds[0] = CRGB::Red;
FastLED.show();
return;
}
if (digitalRead(instantpay) == LOW){
digitalWrite(coinpay, HIGH);
delay(200);
digitalWrite(coinpay, LOW);
}
// Check all 15 ball switches and light the appropraite insert and record the ball as "scored" on that number
for (int i = 0; i<15; i++) {
if (digitalRead(ballswitch[i]) == LOW) {
leds[insert[i]] = CRGB::White;
FastLED.show();
ball[i+1] = 1;
}
}
// Check win lines
for (int i = 0; i<39; i = i + 4) {
int ins = i/4;
// Only check for a win if the line is not already flagged as winner
if (lines[ins] == 0) {
int check = ball[winline[i]] + ball[winline[i+1]] + ball[winline[i+2]] + ball[winline[i+3]];
if (check == 4) {
pay = true;
lines[ins] = 1;
leds[wininsert[ins]] = CRGB::White;
}
}
}
FastLED.show();
}
}
void reset() {
// Reset code to start game
// Turn off all LEDS and set all ball and win tracking to 0
for (int i = 0; i<26; i++) leds[i-1] = CRGB::Black;
FastLED.show();
// Set all ball switches to 0 (off)
for (int i = 0; i<16; i++) ball[i] = 0;
// Set all winning lines to 0 (off)
for (int i = 0; i<10; i++) lines[i] = 0;
// Release balls (coil)
digitalWrite(ballrelease, HIGH);
delay(2000);
digitalWrite(ballrelease, LOW);
// Set game to play and reset payout tracking to false
gameover = false;
pay = false;
return;
}
void payout() {
//Payout code to dispense coins
// Go through all 10 win lines
for (int i=0; i<10; i++) {
// Check if this line is flagged as winner
if (lines[i] == 1) {
// Dispense coins in the correct amount for that win line
for (int x = 0; x < win[i]; x++){
digitalWrite(coinpay, HIGH);
delay(150);
digitalWrite(coinpay, LOW);
delay(250);
}
delay(200);
lines[i] = 0;
leds[wininsert[i]] = CRGB::Black;
FastLED.show();
}
}
// Once wins are paid out game is over and pay flag can go back to false
gameover = true;
pay = false;
return;
}
PINS:
Labyrinth (#21)
Jurassic Park LE (#449)
JAWS Premium
Scooby Doo CE (#141)
Looney Tunes CE (#086)
MultiMorphic P3 with all modules except Lexy Lightspeed
Star Wars Prem
Star Trek the Next Generation
JUKES
Seeburg STD2 Entertainer - Converted to MP3 while retaining the original look and feel. *FOR SALE - $500
NSM Emerald Ice CD(100) wall hanger juke. *FOR SALE - $1400
Gone but not forgotten
So many... Lexy Lightspeed, Recel Lady Luck, Gtb Pro-Football, CCrLE, WOZ ECLE, Stern POTC, Star Trek Pro, MMrRE, Stranger Things LE, Dr Who, RFM, SWEP1, Road Show, Monster Bash, Twilight Zone, Lord of the Rings, Simpsons Pinball Party, Demolition Man, Terminator 2, Funhouse, Tales from the Crypt, High Speed, Bad Cats, Flintstones, WWF Royal Rumble, Laser War, Laser Ball, Silver Slugger, Batman Forever, Pinbot, 6 Million Dollar Man, Galaxy, Meteor, Countdown, Hot Tip(SS), and others I just can't think of lol.
Labyrinth (#21)
Jurassic Park LE (#449)
JAWS Premium
Scooby Doo CE (#141)
Looney Tunes CE (#086)
MultiMorphic P3 with all modules except Lexy Lightspeed
Star Wars Prem
Star Trek the Next Generation
JUKES
Seeburg STD2 Entertainer - Converted to MP3 while retaining the original look and feel. *FOR SALE - $500
NSM Emerald Ice CD(100) wall hanger juke. *FOR SALE - $1400
Gone but not forgotten
So many... Lexy Lightspeed, Recel Lady Luck, Gtb Pro-Football, CCrLE, WOZ ECLE, Stern POTC, Star Trek Pro, MMrRE, Stranger Things LE, Dr Who, RFM, SWEP1, Road Show, Monster Bash, Twilight Zone, Lord of the Rings, Simpsons Pinball Party, Demolition Man, Terminator 2, Funhouse, Tales from the Crypt, High Speed, Bad Cats, Flintstones, WWF Royal Rumble, Laser War, Laser Ball, Silver Slugger, Batman Forever, Pinbot, 6 Million Dollar Man, Galaxy, Meteor, Countdown, Hot Tip(SS), and others I just can't think of lol.