Become educate and have a good time by creating this activity. You will learn about Arduino programming, improve your electronics skill, and practice your shooting skills.
Step 1: Materials and Tools
Collect these materials:
- 2 breadboards
- 5 LEDs
- at least 12 wires
- a pushbutton
- 330 Ω resistor
- 1000 Ω resistor
- 10k Ω resistor
- an Arduino
- a computer
- a USB
- other random materials you want to make a basketball hoop
- small bouncy ball
Tools to use:
- wire stripper
- wire cutter
- hot glue gun
Materials and tools can be found around the house or at you local hardware store and SparkFun
Step 2: The LEDs
For the breadboard, remember you will use pins 3 through 7. Put one end of the wire into each of the corresponding pins and into the column e. Line up the positive ends of the LEDs(anode) in column d and the negative ends of the LED. (Please ignore the black and red long wires in the top right-hand area).
Step 3: The Push Button, LED Resistor, and Power
Using the picture above as a reference, wire up the resistors, wires, and the push button. Follow the diagram to see where to wire up the resistors.
- Place the push button on the other breadboard so that the two unconnected parts are parallel to the short edges of the board
- Take a wire from pin 8 to connect to the 1k Ω. Take the 10k Ω resistor from (+) column nearest to column j to meet up with the 1k Ω resistor in the same row.
- Then, take a wire from the location the two resistor meet to one end of the pushbutton. Take a wire from the other unconnected part to the (-) column nearest to column j
- Using the 330 Ω resistor, connect the column where all the cathodes of the LEDs are line up to connect with a ground(GND) pin
- To supply power to the board, connect a wire from the GND to the (+) column near j.and a wire from the 5V pin to the (-) column.
Step 4: Programming Part 1
There are three parts to every program: The definitions, the void setup, and the void loop.
In this step, we discuss the definitions.
To simplify this program and organize the information, we use the variable shown above.
Step 5: Programming Part 2
Now we talk about the void setup portion. This section is only run once.
That is why we basically turn on the all the pins in this section. Further examination of the pictures will show you we put in Serial.begin99600) to establish the beginning of the program.
Step 6: Programming Part 3
We proceed to end with the final part of the coding, the void loop. This can be seen as the longest part of the code since the information forms the majority of the program.
Read the code and the comments to create the code or a variation of it.
Step 7: The Hoop
Using any miscellaneous material in have around, create somethings to act as a basketball hoop.Make it the appropriate size to fit a small bouncy ball or another sphere
Step 8: Final Product
You are almost done. With a setup similar to what you see, place a cardboard at the bottom of the hoop right on top of the pushbutton. The hoop should line up with the cardboard.
- Turn on program
- Throw ball into hoop
- Use the serial monitor or LEDs to keep track of however shot you have made to this point
- After reaching 5, look at your total time and press the reset button on the Arduino
- Play for however long you feel like
Participated in the
Microcontroller Contest 2017