Steps to Create the Solution
Last updated
Was this helpful?
Last updated
Was this helpful?
We decided to prototype our design in order to fix any kinks and to help iron out any problems that may arise. Our prototype also allowed us to write and debug our code on a fully functional model while the final design was being built.
We cut the sides of the castle out using cardboard as cardboard is easy to work with and easy to modify.
We used duct tape to create our prototype as it is easy to modify and can help us create the quick changes prototypes were made for.
In this step we attached our sensors and began writing and debugging code.
Attached are is the 3D assembly files and the drawing files for each side that must be cut to create the castle. Download them and prepare the drawing files for your laser cutter. There should be a total of 6 unique drawing files.
Using a laser cutter, or a saw, cut out the different sides for the castle paying attention that 1 side of each is slightly longer than the other. This longer side will overhang the other and allow for an even distance on both sides.
Take the piece with a window shaped cutout and drill small holes right under it. The two holes should be about ½ in down from the window and should be about 1 in apart from each other. The holes should have a small area, but big enough to fit screws.
Glue the outside walls together using hot glue. Pay attention to the one with the longer side to ensure the even distance between the two.
Next, glue the other two sides of the castle together. These sides have cutouts on them. When placing them together, the tallest parts of the piece should be hot glued together on the corner.
Then attach the two parts to form a square in the middle.
Then, glue together the third layer of the castle. They are two tall pieces, and one has a window cutout, while the other one is of a similar length. Glue together those pieces, with the non-window piece attached to the right side of the window piece, making an L-shaped form
Next, glue down the L-shaped wood pieces mentioned in the previous step to the outer wall wood piece These pieces should go to the taller side of the square, and corners should touch both sides of the walls. This should also create a square like structure. There should be an opening in the back.
Next, take the small square pieces of wood and attach them to the backside of the castle, along the outer walls, using hot glue. When added to the wall, the entire wall should be as tall as the third layer. Also, use the piece with the small holes for the side adjacent to the window wall, and the other piece adjacent to the non-window wall. In addition. also glue the sides of the small squares which touch each other
Then, take one of the big squares and hot glue it at a 90 angle to the big outer wall. Place it exactly at the edge where both the square height and the wall height are the same. Repeat this step for the other square piece and the wall. Then hot glue the intersection of the two big squares as well.
Then, using a long metal piece, attach 3 line followers to the metal L bracket piece. The line followers should line up with the square holes on the outer wall.
Attach two long strips of metal to the back of the castle, where the small holes are in the outer wall. Line up the strips with the holes, with the first hole of the strips matching up with the top hole. Screw them in accordingly
Take the metal bracket with the line followers and attach it to the metal strips. The third to last holes on the metal strips should attach to the metal bracket. Make sure the line followers and the bracket are accordingly matched up with the holes. Screw in accordingly. Secure wires as well
Raise the whole castle by about 5-6 inches off the ground. We achieved this through the use of wooden blocks. (see above)
Now paint the whole castle grey and detail with black paint
Ramps are made of cardboard and can be custom made to make the balls faster or slower depending on the slope. There should be 5 total ramps following this diagram.
Then insert them with hot glue and paint them.
Attach the light sensor to the metal bracket and attach the metal bracket under the window to the little holes. Attach and secure an extension chord to the light sensor as well.
Attach a Servo to a metal bracket and attach the metal bracket to the small square holes which are adjacent to the “window wall.” Attach an extension cord to the servo wire
Next, build the ball return system. First, take a sheet of birch wood, and add a 2 in. border around 1 whole side of the birch plank, and 2 half sides which are adjacent to the back side
Next, take a smaller piece of wood (½ in. width), and lay it across the birch plank, touching the edge of the side border, and coming all the way down, leaving a 2 in. gap towards the bottom of the plank
Attach a long strip of balsa wood to that 2 in. gap using hot glue
Attach borders for the long strip of wood, which are 1in in width.
Elevate the structure by hot gluing wooden block horizontally to back of the structure (opposite side of the long plank)
Take a sheet of balsa wood, and cut 6 2 in. x 2 in. squares. Take 3 squares and glue them together. and repeat
Then paint it brown and place it under the castle so it feeds balls back towards the front.
Port
Use
Analog 1
1st level light sensor
Analog 2
2nd level light sensor
Analog 3
3rd level light sensor
Analog 4
Light Sensor
Digital 1
Start Button
Digital 2
Stop Button
Digital 6
1st level LED
Digital 7
2nd level LED
Digital 8
3rd level LED
Motor 2
Servo
Here are the steps to write your own code if you want to have some fun.
First, go through and name all the sensors accordingly and place them in the right ports as shown above
Set up variables for the castle score, “start” “castle” and time
While forever, if the start button is pressed, then enter into another while loop (by setting a variable to some number if start is pressed, and the while loop active if that number is the same).
Right before the if statement for the start button, clear the remote LCD lines
In this while loop, first set up the code for the VEX remote screen
In this while loop, have separate if statements, which detail that, depending on which line follower is triggered by a ball going over it (by indicating a decrease in the light value), have it increase the castle score. A respective LED should turn on the same floor of the castle.
The score should increase by 3 for the first castle layer, 1 for the 2nd castle layer, and 5 for the third castle layer
Have another if statement for the light sensor, and if the king is knocked off it (an increase in the light value). Have three LEDs flash if this happens, and break out of the while loop
Also, display on the Vex Remote Screen “You Win” and the time taken to beat the king by recording the time through the time variable
Also, in the 2nd while loop, add an if statement for the stop button, which if pressed, breaks out of the while loop
Here is the full code if you want to just use it.
Full Code