Announcement

Collapse
No announcement yet.

Generic Programming ideas for Homebrew pinball

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    Depending where you buy your parts from
    this is cheap and used for switch denounce and timing
    on the Lawman project.
    Click image for larger version

Name:	one shot timer.gif
Views:	3
Size:	4.1 KB
ID:	1821652

    I did notice times mentioned on this thread of 40 ms
    that is an eternity in pinball, 1ms or less to pickup the switch contact on a stand-up target is required.
    fOr No rAIsOn

    Comment


    • #32
      Originally posted by kress View Post
      I did notice times mentioned on this thread of 40 ms
      that is an eternity in pinball, 1ms or less to pickup the switch contact on a stand-up target is required.
      The 40 ms isn't the length of time the switch has to stay closed. Instead, it is the period during which multiple activations and deactivations are ignored. So, if we get, say, a 1 ms switch closure, the switch is reported as having been activated, and any further activity on that switch is ignored for 40 ms before paying attention to that same switch again.

      Michi.
      May the pinballs tumble in your direction!

      Comment


      • #33
        GAME BOARD

        PICAXE 20M2


        starts the game(1p or 2p depending on C5 status at start )
        enables game power
        will cycle a ball from the troff until ball in shooter lane
        counts/displays the ball
        has a bonus input wait
        extraball input ( ball count bypass )
        ball and game reset outs.


        If anyone is interested further description can be given.

        Click image for larger version

Name:	IMG_20170728_034019233.jpg
Views:	1
Size:	147.1 KB
ID:	1822120


        Click image for larger version

Name:	IMG_20170728_042443415_TOP.jpg
Views:	1
Size:	193.3 KB
ID:	1822121


        'C:\Documents and Settings\User\My Documents\PICAXE Editor\Documents\start program ball counter.xml


        symbol varA = w0

        main:
        low B.0
        low B.1
        low B.2
        do
        do
        pause 10
        loop until pinC.7 = 0
        ;start video
        high B.7
        pause 300
        low B.7
        serout B.6, T2400, ( "game start " )
        let varA = 0
        do
        if pinC.5 = 1 then
        if pinC.6 = 0 then
        if pinC.6 = 0 then
        pause 500
        endif
        if pinC.6 = 0 then
        pause 500
        endif
        high C.0
        ;player 1
        high B.3
        if varA > 0 then
        serout B.6, T2400, ( "end of ball bonus " )
        endif
        do
        pause 10
        loop until pinC.1 = 1
        if pinC.4 = 0 then
        let varA = varA - 1
        serout B.6, T2400, ( "shoot again " )
        endif
        pause 500
        if varA > 2 then
        low B.0
        low B.1
        low B.2
        low B.3
        low B.4
        low C.0
        serout B.6, T2400, ( "match " )
        ;end of ball video
        high B.5
        pause 500
        low B.5
        pause 6000
        serout B.6, T2400, ( "game over " )
        ;end of game video
        high B.5
        pause 500
        low B.5
        reset
        endif
        do
        if pinC.0 = 1 then
        toggle C.3
        pause 200
        toggle C.3
        pause 1500
        endif
        loop until pinC.2 = 0
        let varA = varA + 1
        if varA = 1 then
        serout B.6, T2400, ( "player 1 ball 1 " )
        high B.0
        low B.1
        low B.2
        if pinC.0 = 1 then
        ;end of ball video
        high B.5
        pause 500
        low B.5
        endif
        endif
        if varA = 2 then
        serout B.6, T2400, ( "player 1 ball 2 " )
        low B.0
        high B.1
        low B.2
        if pinC.0 = 1 then
        ;end of ball video
        high B.5
        pause 500
        low B.5
        endif
        endif
        if varA = 3 then
        serout B.6, T2400, ( "player 1 ball 3 " )
        high B.0
        high B.1
        low B.2
        if pinC.0 = 1 then
        ;end of ball video
        high B.5
        pause 500
        low B.5
        endif
        endif
        endif
        else
        if pinC.6 = 0 then
        if pinC.6 = 0 then
        pause 500
        endif
        if pinC.6 = 0 then
        pause 500
        endif
        high C.0
        if varA > 0 then
        serout B.6, T2400, ( "end of ball bonus " )
        endif
        do
        pause 10
        loop until pinC.1 = 1
        if pinC.4 = 0 then
        let varA = varA - 1
        serout B.6, T2400, ( "shoot again " )
        endif
        if varA > 5 then
        low B.0
        low B.1
        low B.2
        low B.3
        low B.4
        low C.0
        serout B.6, T2400, ( "match " )
        ;end of ball video
        high B.5
        pause 500
        low B.5
        pause 6000
        serout B.6, T2400, ( "game over " )
        ;end of game video
        high B.5
        pause 500
        low B.5
        reset
        endif
        do
        if pinC.0 = 1 then
        toggle C.3
        pause 200
        toggle C.3
        pause 1500
        endif
        loop until pinC.2 = 0
        let varA = varA + 1
        if varA = 1 then
        serout B.6, T2400, ( "player 1 ball 1 " )
        high B.0
        low B.1
        low B.2
        high B.3
        low B.4
        if pinC.0 = 1 then
        high B.5
        pause 500
        low B.5
        endif
        endif
        if varA = 2 then
        serout B.6, T2400, ( "player 2 ball 1 " )
        high B.0
        low B.1
        low B.2
        low B.3
        high B.4
        if pinC.0 = 1 then
        high B.5
        pause 500
        low B.5
        endif
        endif
        if varA = 3 then
        serout B.6, T2400, ( "player 1 ball 2 " )
        low B.0
        high B.1
        low B.2
        high B.3
        low B.4
        if pinC.0 = 1 then
        high B.5
        pause 500
        low B.5
        endif
        endif
        if varA = 4 then
        serout B.6, T2400, ( "player 2 ball 2 " )
        low B.0
        high B.1
        low B.2
        low B.3
        high B.4
        if pinC.0 = 1 then
        high B.5
        pause 500
        low B.5
        endif
        endif
        if varA = 5 then
        serout B.6, T2400, ( "player 1 ball 3 " )
        high B.0
        high B.1
        low B.2
        high B.3
        low B.4
        if pinC.0 = 1 then
        high B.5
        pause 500
        low B.5
        endif
        endif
        if varA = 6 then
        serout B.6, T2400, ( "player 2 ball 3 " )
        high B.0
        high B.1
        low B.2
        low B.3
        high B.4
        if pinC.0 = 1 then
        high B.5
        pause 500
        low B.5
        endif
        endif
        endif
        endif
        loop
        loop
        stop
        Last edited by kress; 28th July 2017, 02:53 AM.
        fOr No rAIsOn

        Comment


        • #34
          Planning my home brew pinball and the thought came to me about multiball so has anybody got any ideas of how to programme an Arduino to handle 4 ball multiball ?
          Interested to see if anyone else has done this or thought about this, maybe someone can help with the code and pointers where to start.
          Thanks

          Comment


          • #35
            I have written a program in C for a picaxe for 4 balls.
            It has an 8 bit address and enable in 1,2,3,4, ball save timers( multiball start ) a multiball hold and restart sequence.
            This is this easy part of Multiball.

            What starts multiball how many different multiball are there and how do you reset /activate them( multiball end ,player 1,2,3,4,).
            What shots are active how are they lit what happens when you shoot them( lighting sound animation scoring).
            When you collect all the shots what happens(....).
            Jackpots, supa jackpots and supa double jackpots (....).
            How do you inhibit standard play ,modes and multiball from interacting.
            Last edited by kress; 17th August 2017, 10:33 AM.
            fOr No rAIsOn

            Comment


            • #36
              Originally posted by kress View Post
              I have written a program in C for a picaxe for 4 balls.
              It has an 8 bit address and enable in 1,2,3,4, ball save timers( multiball start ) a multiball hold and restart sequence.
              This is this easy part of Multiball.

              What starts multiball how many different multiball are there and how do you reset /activate them( multiball end ,player 1,2,3,4,).
              What shots are active how are they lit what happens when you shoot them( lighting sound animation scoring).
              When you collect all the shots what happens(....).
              Jackpots, supa jackpots and supa double jackpots (....).
              How do you inhibit standard play ,modes and multiball from interacting.
              A single software stack - Not bit's of code in various devices around the cab.

              Comment


              • #37
                Originally posted by ozfalcon View Post
                A single software stack - Not bit's of code in various devices around the cab.
                I'd certainly be interested in obtaining this? how can I get a copy and can it be modified to do 5 ,7 or more multiball

                Comment


                • #38
                  I have only just found this thread, so am a tad late to the party.

                  In my designs, I use a simple R/C filter on switch inputs to tame any spurious RF on the wire. The software takes care of deciding what's a valid input transition.

                  As for firing solenoids, etc I have a software timer associated with each that gets checked / decremented in a ticker interrupt (usually each 1ms or 10ms).

                  That way I only have to fire the solenoid and not worry about the release. Sometimes each output will be a structure with variables for current state, desired duration, tick count, lockout time, etc.
                  "Everyone's always in favour of saving Hitler's brain. But when you put it in the body of a great white shark, ooohh! Suddenly you've gone too far!"

                  Comment


                  • #39
                    Originally posted by andyarcade View Post
                    I'd certainly be interested in obtaining this? how can I get a copy and can it be modified to do 5 ,7 or more multiball
                    I think you might need something more powerful than an arduino to do it all ...its a bit too stupid to handle everything.
                    Even Stern have had multiball issues with their last three games ( I assume they have some experience programming multiball ).
                    Last edited by kress; 18th August 2017, 06:33 AM.
                    fOr No rAIsOn

                    Comment


                    • #40
                      The processor on most Arduino boards is actually pretty good. Even the ATMEGA328 used on the Nano (and Uno ?) had 32K of FLASH and 2K of RAM.

                      What limits the processing speed a lot of the time is the many layers of the Arduino functions.

                      You can program in C to speed things up and still use the boot loader, or you can switch to Atmel Studio and burn the chip directly.

                      Of course you will need to learn how to talk to the registers directly, but there are plenty of examples out there.
                      "Everyone's always in favour of saving Hitler's brain. But when you put it in the body of a great white shark, ooohh! Suddenly you've gone too far!"

                      Comment


                      • #41
                        Originally posted by andyarcade View Post
                        I'd certainly be interested in obtaining this? how can I get a copy and can it be modified to do 5 ,7 or more multiball
                        Well the way I would approach it would be to have one Main CPU - Be it x86 or Arm (PC or Pi etc).

                        If you still wanted Arduino in the mix as sub systems, Then the Main CPU initiates the modes and either handles it internally or sends a signal to a device eg multiball controller thus enabling it's operation as needed within the framework of the gameplay.

                        Something like MP would be your main CPU software.
                        http://missionpinball.org/

                        Comment


                        • #42
                          I give in.
                          fOr No rAIsOn

                          Comment


                          • #43
                            Originally posted by kress View Post
                            I give in.
                            It depends on what type of Pinball your trying to make.

                            Your either making something that operates in a similar fashion to a EM pinball.

                            ----> Sitting in-between would be using smart devices with no main cpu to bring it all together
                            (As long as your aware of the limitations/difficulties this is a perfectly acceptable solution)

                            Or your making something like a modern pinball with all the flexibility & complexity of software.

                            Comment


                            • #44
                              Thanks guys certainly gave me something to think about, but I don't want to use a pc or mission pinball in this project, I have used pc's before in Virtual pinball cabs
                              I was going to use an Arduino or a few of them to handle different operations ,but I have been experimenting with the chipkit Max32 and that seems the way to go since it offers more outputs, either way I would be programming in C code,
                              and it's going to be like Firepower but with a modern ball trough installed and 5 ball multiball, and not 4 as originally planned, so lock 3 balls just like Firepower does now, then eject two balls one after the other from the trough and release the 3 locked balls one after the other, does that seem possible ? So two issues how to code the ball trough and how to code multiball ?

                              Comment


                              • #45
                                Originally posted by andyarcade View Post
                                Thanks guys certainly gave me something to think about, but I don't want to use a pc or mission pinball in this project, I have used pc's before in Virtual pinball cabs
                                I was going to use an Arduino or a few of them to handle different operations ,but I have been experimenting with the chipkit Max32 and that seems the way to go since it offers more outputs, either way I would be programming in C code,
                                and it's going to be like Firepower but with a modern ball trough installed and 5 ball multiball, and not 4 as originally planned, so lock 3 balls just like Firepower does now, then eject two balls one after the other from the trough and release the 3 locked balls one after the other, does that seem possible ? So two issues how to code the ball trough and how to code multiball ?
                                Why not go for a Williams system 6...FirePower original board set...Or a system 7 board set?.

                                That way you know it will work and replacements are easy to come buy.

                                Either has 3 ball multi ball in some games and then you can concentrate on actually building the machine rather than having to do all the board programming and board design work as well.

                                This way, if variations to the original game software don't allow exactly what you want your game to do, you can alter them using "external boards" much like Williams did on system 9-11 board sets when they found there original board sets didn't have enough inputs and drives or like Bally did with there soloniod and lighting expansion boards.

                                If you actually enjoy the programming side of homebrew, disregard what I have written.

                                I for one find software very frustrating and it is all about making something unique playfield and game play wise but I understand some may like to build every aspect of the homebrew.

                                Comment

                                Users Viewing Topic: 0 members and 1 (guests)
                                Working...
                                X