Let's Play Baseball( Arduino Reaction Testing Machine)
by Zhang0821 in Living > Health
417 Views, 0 Favorites, 0 Comments
Let's Play Baseball( Arduino Reaction Testing Machine)
Introduction to my design:
-When you are looking at the above image, you might think of a mobile baseball game, a game that is popular in modern phone games. As a fact, as ages rise, our intelligence, memory, and reaction start to decrease too. Then my design has the function of rehabbing and strengthens our reaction, to keep our brain working without stopping. The design is like a phone game but in a form of physic.
How does my design work:
-The way of operating the product is simple and easy. First, when the user plugin the Arduino motherboard with a computer, the LEDs will start to shine. There are four LEDs, as the last and the bottom LED shines, the user should press the bottom beside as batting, the computer will detect that if the user hits the ball or not, if YES, the LCD besides will show SAFE, if NO, the LCD besides will show OUT.
Target audience:
-Aging people: Their intelligence, memory, and reaction decrease as their age rises. By playing the machine, to strengthen their reaction, keep playing every day, trust the process.
-Athletes: Athletes who are playing sports that stress reaction, like baseball, badminton, etc. By playing the machine, to have better coordination between eyes and hands, to train their reactions.
-Children: Play with the machine as a game for children, instead of play phones, play with the machine to train their reactions.
Possible problems and improvements:
-Might feel boring after playing times
-Too simple and the size of the machine is too big
-Add additional functions- like extends to a more likely a baseball game, extends to have rounded, 3 safse/4 balls/foul, and also can add a home run, hit, etc.
-Not only have one way of pitching, can add many ways to increase the level for users.
Step 1: Supplies Needed
1.Arduino Leonardo
2.Male to male Arduino Jumper Wires
3.Button
4. LEDs
5.LCD
6.Tape
7.Scissor
8.Tap c & Arduino connect line
9.Green resistances & purple resistances
10.Any box that is bigger than the Arduino Leonardo
Step 2: Connecting the Circuit
1. + line wires to 5v
2. - line wires to GND
3.1st LED, first wires two wires with a LED, then two sides of the LED wire to green resistance, wire a line to D-pin 11(in front of the LED), wire with - line.
4.2st LED, first wires two wires with a LED, then two sides of the LED wire to green resistance, wire a line to D-pin 10(in front of the LED), wire with - line.
5.3st LED, first wires two wires with a LED, then two sides of the LED wire to green resistance, wire a line to D-pin 9(in front of the LED), wire with - line.
6.Button, first wires two wires with the button, then two wires of the button wire to purple resistance, wire a line to D-pin 12(in front of the button line), wire with - line and +line.
7.LCD, SCL with SCL, SDA with SDA, connect + with VNN, connect - with GND.
Step 3: Make and Draw a Box
First: Find a box that is bigger than the Arduino Leonardo
Second: Draw a baseball field
Third: Cut holes for putting LEDs, LCD, and buttons.
Step 4: Code
#include
#include
// For these LCD controls to work you MUST replace the standard LCD library from... // https://github.com/marcoschwartz/LiquidCrystal_I2C // Direct download https://github.com/marcoschwartz/LiquidCrystal_I2C/archive/master.zip // Your project will not compile until this is done. LiquidCrystal_I2C lcd_I2C_27(0x27,16,2); // set the LCD address for a 16 chars and 2 line display
void setup(){ // put your setup code here, to run once: pinMode( 11 , OUTPUT); // sets the digital pin as output pinMode( 10 , OUTPUT); // sets the digital pin as output pinMode( 9 , OUTPUT); // sets the digital pin as output pinMode( 4 , OUTPUT); // sets the digital pin as output pinMode( 12 , INPUT); // sets the digital pin as input lcd_I2C_27.init (); // initialize the lcd lcd_I2C_27.backlight(); }
void loop(){ // put your main code here, to run repeatedly: digitalWrite( 11 , HIGH ); // sets the digital pin on/off digitalWrite( 10 , LOW ); // sets the digital pin on/off digitalWrite( 9 , LOW ); // sets the digital pin on/off digitalWrite( 4 , LOW ); // sets the digital pin on/off delay( random( 1000 , 3000 ) ); // waits a few milliseconds digitalWrite( 11 , LOW ); // sets the digital pin on/off digitalWrite( 10 , HIGH ); // sets the digital pin on/off digitalWrite( 9 , LOW ); // sets the digital pin on/off digitalWrite( 4 , LOW ); // sets the digital pin on/off delay( random( 1000 , 3000 ) ); // waits a few milliseconds digitalWrite( 11 , LOW ); // sets the digital pin on/off digitalWrite( 10 , LOW ); // sets the digital pin on/off digitalWrite( 9 , HIGH ); // sets the digital pin on/off digitalWrite( 4 , LOW ); // sets the digital pin on/off delay( random( 1000 , 3000 ) ); // waits a few milliseconds digitalWrite( 11 , LOW ); // sets the digital pin on/off digitalWrite( 10 , LOW ); // sets the digital pin on/off digitalWrite( 9 , LOW ); // sets the digital pin on/off digitalWrite( 4 , HIGH ); // sets the digital pin on/off delay( random( 1000 , 1500 ) ); // waits a few milliseconds if (digitalRead( 12 )) { lcd_I2C_27.clear(); lcd_I2C_27.setCursor(0 , 0) ; // set the cursor, counting begins with 0 lcd_I2C_27.print( "SAFE" ); // Print a message to the LCD. delay( 1000 ); // waits a few milliseconds lcd_I2C_27.clear(); } else { lcd_I2C_27.clear(); lcd_I2C_27.setCursor(0 , 0) ; // set the cursor, counting begins with 0 lcd_I2C_27.print( "OUT" ); // Print a message to the LCD. delay( 1000 ); // waits a few milliseconds lcd_I2C_27.clear(); } }
Step 5:My Code on Arduino Cloud
Press the down link to see the code
https://create.arduino.cc/editor/ryanzhang0821/e2d4c7eb-d236-453e-907f-5590b35f7ce6/preview