Multifunction TImer
In oftentimes, people need a timer to do many things like a countdown or other uses. Timers can also be used as a 24-second shot clock for basketball. 24-second shot clocks can help basketball players simulate the feeling during a game so if players experience the same kind of intensity or feeling in a real game many times, they will not be nervous when it comes to the real game. This is called a Multifunction Timer because it can not only time normally, it can also help normal people and basketball players.
Original Idea: https://www.instructables.com/Personal-Shot-Clock/
Supplies
To make this shot clock, you will need the following:
- Arduino x1
- Breadboard x1
- Jumper Wires
- 10K ohm resistors x2 - Seven segment displays (SSD) x2 - Button x1
(Pre Step) Understanding How SSD Works
The seven-segment displays are really just seven LED lights lined up in a particular pattern. Each of the seven LEDs is called a segment because when illuminated the segment forms part of a numerical digit (both Decimal and Hex) to be displayed. An additional LED light, which is the 8th one, is sometimes used for indicating decimal points. Each one of the seven LEDs in the display is given a positional segment with one of its connection pins being brought straight out of the rectangular plastic package. These individual LED pins are labeled from a through to g representing each individual LED. The other LED pins are connected together and wired to form a common pin.
To turn on and off a particular part of the display, you set the appropriate pin HIGH or LOW just like you would with a regular LED. So that some segments will be light and others will be dark allowing the desired character pattern of the number to be generated on the display. This then allows us to display each of the ten decimal digits 0 through to 9 on the same 7-segment display.
Preparing the Button
In this project, I have made use of a button because this way the players can control whether they want the time to stop or start. The countdown starts from 36 (as I changed) after the button is being pressed. After the countdown ends, the button will be available to be pressed but not during the countdown. I made this because this project's main purpose is to let basketball players practice how they would handle a game situation by practicing tough shots with a time limit. Being in the mindset of a game late in the fourth quarter is one of the most intense mindsets children and professional players have.
Code for this
Under 'void loop()', you need to write the following:
button = digitalRead(10); Serial.println(button) if (button == HIGH) { for (int i = 24; i >= 0; i--) { displayDigit(i); delay(1000); turnoff(); } }
Preparing the Buzzer
Buzzers are used for the 24 second time because players need to know when to stop the offense, in this case, the time will be 30 seconds. The buzzer has two legs; a positive leg and a negative leg. A wire should be connected from the positive leg to the digital pin you want to use (in my case, I used pin 9). Whenever you use a buzzer and you want to produce a sound, you must input the number of hertz you want to output so that the buzzer can produce the pitch you want. I used 200 hertz as it sounds very similar to the one used in professional basketball matches.
You must also state how long you want the sound to be produced in milliseconds (1000 milliseconds = 1 second).
The code will be the following:
{ tone(13, 128); delay(3000); noTone(13); }
From the example above, we can find three pieces of information conveyed in the code. - The pin used: pin 13 - The pitch produced: 128 hertz - How long the sound is produced: 3 seconds (3000 milliseconds)
Putting All Pieces Together (Wires, Button, Buzzer, Etc)
Above is the image of what the project should end up looking like.
Hope this picture can help you understand how to build it.
The video has more than 30 seconds because you need to wait for the shot clock to buzz.
Link to code: https://create.arduino.cc/editor/howardchen/8fe1d6...