Soccer Pinball
     an ME218A Project

ME218A: Soccer Pinball

Dept. of Mechanical Eng. | Stanford University



cool looking code

Game Logic

Software Design

The Pinball Soccer game uses embedded software programmed on a C32 microcontroller.  The software is written in C, and was organized into modules to improve development, team collaboration and debugging. 

Module Descriptions

The following modules provided the basic functionality of the Soccer Pinball experience

Main Program Process Flow

Start
        Configure and initialize everything
        Game loop
                 Wait for penny
                 Start game
                 Play loop
                          Check events
                           Respond to event
                 End play loop
                 Check score and dispense prize
                 Reset game
        End game loop
End

Microcontroller I/O

Port M

0 - opponent goal sensor input
1 - player goal sensor input
2 - penny coin sensor input
3 - goalie direction output
4 - prize dispenser enable output
5 - right flipper direction output

Port AD

0 - difficulty potentiometer analog input
1 - sound output control signal
2 - goalie direction change input (limit switches and 2nd player button)
3 - left flipper button input
4 - right flipper button input
5 - left flipper enable output
6 - left flipper direction output
7 - right flipper enable output

Port T

0 - Goalie speed (PWM)
1-2 - unused PWM
3 - scoreboard clock pulse output
4 - opponent score output
5 - time ones digit output
6 - time tens digit output
7 - player score output