Hello everyone! In this tutorial we will create light controlled robot cars and play soccer with them. It will be similar to Rocket League, except we will use arms attached to servo motors to hit the ball.
This tutorial assumes that you have a working environment setup with the Arduino IDE and Cardublock library. See here for more information.
View this post on Instagram
CAROBOT Soccer is coming to @makerfestival 2018! Control our robots with a flashlight and try to score a goal against your opponents. Come by our booth next weekend and check it out! __ Interested in signing up your child for our robotics classes in #markham? Visit the link in our bio to find out more! __ Are you an educator interested in making teaching #robotics easy? DM us for more info! . . . #toronto #arduino #engineering #technology #innovation #software #diy #computers #tech #stem #steam #raspberrypi #canada #makers #code #computerscience #science #education #programming #yorkregion #ontario #edutainment #robot #stemeducation #makerfestivalto #fifa #fifa2018 #worldcup
- Arduino Uno
- SwissCHEESE Kit
- Hitec HS-311 Standard Economy Servo
- SwissCHEESE Light Sensor X 4
- Robot Car Chassis Of Your Choice
- Gearmotor and Wheel Set X 2
- M4 Nuts And Bolts X 12
- A ping-pong ball
- A power source for the Arduino (we use a 3000mAh NiMH battery pack)
Note: we will be using our own robot car configuration including two motors and a caster. Feel free to use your own robot car as long as it is controlled with the Arduino, and has 2 DC motors included.
- Mount the Arduino on the car chassis, and then mount the SwissCHEESE shield on the Arduino.
- Using 2 nuts and bolts, attach the servo face at the front end of your robot car.
- Using 2 nuts and bolts, attach 2 brackets to the servo to form the kicker.
- Using 2 nuts and bolts per light sensor, attach one at the front, back, left and right sides of the chassis.
- When wiring, make sure that the Arduino USB wire is not plugged into the computer.
- Attach the wires of the two motors to the SwissCheese at M1, and M2.
- Connect a jumper wire from:
- I0 to the light sensor on the right.
- I1 to the light sensor on the front.
- I2 to the light sensor on the left.
- I3 to the light sensor on the back.
- O0 to servo at the front.
- Open up Arduino IDE, and go to Tools –> CarduBlock Edu to open up the Cardublock user interface.
- Subroutines make your program easier to read. To use subroutine blocks, or delays look in Control. To use motor blocks, or servo blocks, look in CAROBOT SwissCHEESE. Using this, assemble 6 subroutines like below.
- Next, create the following below. To use the loop, or if else statements, look in Control. To use the orange comparison blocks, look under Tests. To use the light sensor, look in CAROBOT SwissCHEESE.
- Now connect the Arduino USB wire to the computer and hit “Upload To Arduino” *
*Make sure you have the following selected: Tools –> Boards –> Arduino Uno/Genuino, and Tools –> Ports –> COMX (where x is a number).