Score Keeping

So I was thinking making a pin ball machine and using an arduino as it's brain but I'm not the smartest programmer so I'm wondering if anyone out there could help me.

So here's my plan. I want to use a bunch of piezo sensors as the bumpers (I think that's what you call them) so that when the ball hits them the score adds up, but I don't know how I would declare /program that.

Help Pleas :-[

Are you planning to use the same metal ball used in a full size pinball machine?

sounds like a lot of broken sensors to me... piezoelectric sensors are minutely flexible... but probably not tolerant of a steel ball bearing hit at high velocity.

You might want to do some research and find out what existing pinball machines use for bumper switches. My guess would be lever switches on all sides of the bumper wired in series.

If you want all of the bumpers to register the same score, just have all of the bumper switches wired in series to one pin and have the loop watch that pin and add an increment to your score variable each time that pin reads HIGH. If some of the bumpers are harder to reach, you could have them wired to a different pin where it would increment more for each hit.

You would have a variable for the score which increments whatever number you choose each time a bumper is hit, and could subtract a certain number from the score if you lose the ball. You'd want to have some kind of bumper or switch that the ball would hit when it rolls off the bottom of the table so that the machine knows that you just lost. This way it could subtract something from your score if you didn't hit enough bumpers (or if you hit less than last time).

As the score increases, it could trigger lights or buzzers wired into other pins:

if (digitalRead(bumperPin, HIGH) {
  score++;
}

if (score >= 100) {
  digitalWrite(buzzerPin, HIGH);
}

I would also suggest writing the highest score to EEPROM so it will save it for next time. At the end of each game, if the score of that game is equal to or greater than the high score set in the EEPROM it would show some kind of "NEW HIGH SCORE!!!" display and write the new highest score to the EEPROM, this way, even if you don't use the machine for a while and leave it unplugged, next time you use it, there's your old high score waiting for you to beat it.

You might want to use a serial LCD or serial 7-segment display to display the score, this way you can save pins for bumpers and lights.

P.S. Sorry, I gotta make the reference: "How do you think he does it, I don't know, what makes him so good?" -The WHO