Table Hockey With Pinoo
Project Purpose: To make a table hockey project using Lcd, button and ldr modules with Pinoo control card.
Duration: 2 lessons
Age Group: 7 years and older
Benefits:
• Learns to code Pinoo control card.
• Learns to use the LCD module.
• Learns to use the LDR module.
• Learns to use button module.
• Improves the skill of setting up algorithms.
• Improves coding skill.
Materials to be used: Mblock 3 program, Pinoo control card, button module, lcd module, ldr module
Materials Required for Design: Large forex, scissors and a utility knife, a round piece of wood, 2 hard plastic cups (I used a glass removed from a 3D printer) silicone gun and silicone.
Project Preparation:
1. For our project, let's start with painting the glasses first.
We paint one blue and one green acrylic paint.
We will design a castle in the same color.
We paint the piece of wood in black.
We cut the 61x39 cm piece from the forex with a utility knife.
When cutting the fork, it may be necessary to cross several lines several times.
We cut the 36x10 cm piece from the forex with a utility knife.
We cut the 62x10 cm piece from the forex with a utility knife.
We draw a line from the midpoint of these parts. From this line we draw another 1.1 cm thick line. We leave 0.5 cm distance from the edges.
(One side will be approximately 4 cm in value. We will silicon that part to the lower part in the next steps.)
We cut the forex lines with a utility knife.
We silicone the pieces we cut on the edges of the large piece. In this way, we design a table that can stand.
We draw a hole of 8cm size so that round wood passes to the middle point of the 36x10 cm pieces 4cm above.
We cut the forex with a utility knife as we have drawn.
We silicone the flat parts on the side of the table, on the bottom.
We silicone the other parts on the side of the table, on the top.
It will look like the figure.
We drill holes in the back of both castles where the ldr module can enter.
We silicone ldr modules from the bottom of the table.
We cut the holes close to a castle, both from the bottom and from the vertical side, where the connection cables of the modules can pass with a utility knife.
At the bottom of the table, we attach it to doors 7 and 8 with the connection cables of the ldr modules.
We attach the connection cable to the 10th door where we will install the Ldr module and remove it from the holes at the top.
To install the button module, we attach the connection cable to the 1st door and remove it from the upper part through the holes.
The cables protruding to the top.
We silicon the lcd and button module near the points where the cables come out.
We install the connecting cables of the modules.
We paint the castle on the left in blue and the castle on the right in green.
We plug the USB connection cable to the Pinoo control card and the computer from the bottom of the table. Now we can start coding.
2.Adding Pinoo extension:
From the Extensions tab, we click on the "Manage Extensions" option.
In the window that opens, we type "Pinoo" into the search engine and simply say download to the result.
It was installed on our computer.
3.Connecting the Pinoo control board to the computer:
In Mblock 3, we click on the "Connect" tab on the upper left.
We click on the "Serial Port" section from the window that opens and select the "COM6" option from the page that opens. NOTE: Since the port entries of each computer are different, the numbers next to the COM text may change.
We click on the Cards tab.
We select the "Arduino Nano" card option used by the Pinoo control card from the window that opens.
We click on the Extensions tab.
In the window that opens, we select the extension "Pinoo" of the control card we are using.
We click on the Connect tab.
We click on "Firmware Update" from the window that opens.
4. Coding part:
First of all, we need to install a necessary library, mblock program, in order to use the lcd module. Otherwise, the lcd module will not work.
We write lcd i2c library arduino info on the search button and click the site on the screen in the results.
We are downloading the Newliquidcrystal 1.3.5.zip file found on this site.
After the download is finished, we go to the C section of our computer and click on the Program Files folder.
In this area, we click on the mBlock folder.
In this area, we click on the Arduino folder.
We click the right mouse button on the arduino.exe file in this folder and click the Run as administrator option from the window that opens.
After opening, we click on the ‘’Include Library’’ option from the ‘’Draft’’ menu. We click on the ‘’Add .ZIP Library’’ option from the window that opens.
Here we find the folder with the downloaded file and select the file.
We will see a message on the screen that the library has been added.
After this process is finished, you can close the arduino program
ir.
Now we can continue from the Mblock program.
First, we click the ‘’Create a Variable’’ button under the ‘’Data / Block’’ tab to create a variable.
We write blue in the area that opens and click the OK button.
With the same method, we create a variable named green.
These are the variables we create
First, we start with the Pinoo program code block and set the values of the variables to 0.
Then we prepare the LCD screen.
Then we get the necessary code block to print text on the LCD screen.
Line 1 1. We start printing on the column and print the text "Blue:". So we print out the value of the blue castle.
Then we print the value 0 in 1st Row, 6th column.
(It will display "Blue: 0) on the screen.)
Then we get the LCD print code block to print the value of the green castle on the LCD screen.
2. Line 1. We start printing on the column and print the text "Green:".
Then we print the value 0 in the 2nd Row 7th column.
(It will display "Blue: 0) on the screen.)
We take the control structure with continuous repetition and add the condition structure ‘’if it is’’. Then we write our requirement. Our condition is ‘’The value read by the ldr module attached to the 8.door is less than 100’’. So it means that the black part passes through the castle.
If our condition is correct, we increase the green variable by 1 and print it in the 2nd row, 7th column, where the value is 0. Then we wait 2 seconds.
(Here means a goal has been scored in the blue goal.)
We add a new, if any, condition structure and write our condition. If the value read by the ldr module attached to the 7. door is less than 100, that means the black piece is passing through the castle.
If our condition is true, we increase the blue variable by 1 and print it in the 1st row, 6th column, where the value is 0. Then we wait 2 seconds.
(Here means a goal has been scored in the blue goal.)
We add a new, if any, condition structure. We are stating our condition. We check whether the value of the blue variable is equal to 5.
(For the winner of the game 5)
If our condition is correct, we clean the LCD screen and state that the blue wins.
We add a new, if any, condition structure. We are stating our condition. We check whether the value of the green variable is equal to 5.
(For the winner of the game 5)
If our condition is correct, we clean the LCD screen and state that the green wins.
We add a new, if any, condition structure. We are stating our condition. Our condition is ‘’The state of the button module mounted on the 1. door is 1. we arrange the side so that the button is pressed’’.
We will use the button to start the game from seven.
If our condition is true, we make the values of the green and blue variables 0.
We clear the screen and state that the blue and green variables are 0.
(You can get these code blocks by copying them from the coding part in the first steps.)
We right click on the "Pinoo Program" command and select the "Upload to Arduino" option in the window that opens.
On the page that opens, we click on the "Upload to Arduino" button selected in red.
Our codes are uploaded to our Pinoo control card.
We click on the "Close" button after the "Download Finished" text appears.
5. Working Status of the Project:
We insert the 9V battery from the bottom of the table.
Let's play the game and earn scores and when it reaches 5, let's start the game again with the button.