I need some help creating this racing game and would appreciate any help you can provide.
Is there an optical sensor for a pinball-like game?
Can it connect through Arduino to advance a counter?
Can the counter be a row of LEDs?
Discussion: When the ball is shot up, it then drops down and it can go in one of three slots. The outside slots count as 1 and the center slot counts as 3 points.
When the ball passes over the optical sensor it advances some kind of counter which is attached to a row of LEDs.
Each time the ball scores, the sensor tells the light to advance the number of spaces until it reaches the end (25 lights).
I'm not sure how to make this game but I think the optical sensor would work when the ball passes over it. I would greatly appreciate comments and assistance with this.
Can an Arduino even do all of this?
Yes. A sensor can indicate to a program that an event occurred (a ball blocked its sight). The program will monitor the sensor for a change. When the change in the sensor state occurs, the program will update a counter. The program will extinguish the previous LED (old counter value) and illuminate the current LED with the new counter value. When the program counter reaches 25 something else can be programmed to happen.
This is a relatively simlpe program on the face of it.
There are many optical sensors, some of which could be used as ball sensors. Can you hive us some of idea of the way the game is made? What is the diameter of the ball.
The game will be like a pinball game.
Shoot the ball and each time the ball goes through one of three slots the counter causes an LED to light.
Each slot is worth 1, 2, or 3 points. The lights illuminate according to which slot the ball rolls down through.
This continues until one person reaches the 30 movements/points and the whole game ends.
Then I reset and start over. I used to play something similar at the state fair with my mom. That game was made in the 1930's. I want to make it for fun because the game was disassembled and sold as scrap. It was a one-of-a-kind.
I'm not really sure it makes a difference. The slots will be capable of the ball moving through easily. The standard size for pinball balls is 1-1/16 inches in diameter, or 27 millimeters. These balls are used in most modern pinball machines made after 1950. They weigh around 2-7/8 ounces and are made of carbon steel. Pinball balls should be polished to a G100 surface finish and shipped with a light coat of oil for protection. Before use, clean the balls thoroughly. A rusty, scratched, or pitted ball can damage the playfield.
I'm teaching myself all of this and your info confirmed what I was thinking. This is my retirement project - or part of it. Learn coding and combine my wood working with electronics and computers. Thank you for responding.
For the optical solution you will probably need an emitter and matched detector. So that is a modulated (38KHz) IR LED and a TSSOP4038 or equivalent sensor for each lane..
The reason for the emitter modulation (see tone() function) is so the detector ignores unmodulated ambient light.
A choice for low-cost and ease-of-use is the Light Dependent Resistor (LDR). The properties of the LDR decrease resistance with the presence of light and increase resistance when blocked from light. Your program will look for a voltage increase (E=IR... as R increases, E decreases) as the ball quicly rolls over the LDR. You can get these for US$0.10 to US$0.70 from Amazon.
There are endless choices for learning about programming Arduino. I like to point out Programming Electronics Academy for a very understandable, very structured method of showing while learning videos. Their YouTube channel has a section "Start coding with Arduino" for a good starting point.
As you advance, check DroneBotWorkshop who does in-depth examples with YouTube videos:
I need some help creating this racing game and would appreciate any help you can provide.
Is there an optical sensor for a pinball-like game?
Can it connect through Arduino to advance a counter?
Can the counter be a row of LEDs?
Discussion: When the ball is shot up, it then drops down and it can go in one of three slots. The outside slots count as 1 and the center slot counts as 3 points.
When the ball passes over the optical sensor it advances some kind of counter which is attached to a row of LEDs.
Each time the ball scores, the sensor tells the light to advance the number of spaces until it reaches the end (25 lights).
I'm not sure how to make this game but I think the optical sensor would work when the ball passes over it. I would greatly appreciate comments and assistance with this.
Can an Arduino even do all of this?
Just read a few dozen posts here or in the "Programming Questions" section. You'll see ppl do amazing, even almost impossible, things with an Arduino board.
Old timers woukd wonder why you'd need an Arduino at all.
Set yourself and chatGPT the task of using a pushbutton that makes a number increases by one, and prints it to the serial monitor, each time you press it. The button.
If you can do that, you will have been dragged over stuff that gets in everyone's way sooner or later, so start there and don't move on to optical sensors or rows of LEDs until you have succeeded.
And can explain it to yourself.
Then ask chatGPT for help making a LED be on if the number is currently even and off if the number is currently odd.
That'll drag you further along, and won't be a waste of time.