The paper is concerned with the control of a pinball machine. The plant is a hybrid system because of the continuous movement of the ball and the only discrete sensors and actuators. As no additional optical sensors are used, a complicated discrete event control problem arises. With the help of an identified Semi Markov Model, an optimal controller is designed and tested.