In order to receive credit:
Program must be named correctly
Program must be downloaded and previously tested by student
Program must work correctly
Program is up/visible on computer screen so I can see it as the robot performs
Naming Programs:
Name programs as follows:
P (period number) R ( robot number) + program name
example: P1R8 one rotation would be the correct name for period 1, robot 8 program named "one rotation".
First, set your PARAMETERS
In Spike Prime, ALWAYS SET YOUR PARAMETERS
The first three blocks after the EVENT block set the parameters for the program. This is important so that the robot knows which motors to use for driving, how fast to go, and what the distance will be for each rotation of the wheels.
__________________________________________________________________
Now, write some PROGRAMS
Programs and what they should do:
Spike Prime
P_R_ one rotation
Robot moves forward for one rotation of both wheels when center button is pressed.
In Spike Prime, ALWAYS SET YOUR PARAMETERS
The first three blocks after the EVENT block set the parameters for the program. This is important so that the robot knows which motors to use for driving, how fast to go, and what the distance will be for each rotation of the wheels.
Spike Prime
P_R_ 720 turn
Robot turns by moving the left motor (B) 720 degrees.
In Spike Prime, ALWAYS SET YOUR PARAMETERS
The first three blocks after the EVENT block set the parameters for the program. This is important so that the robot knows which motors to use for driving, how fast to go, and what the distance will be for each rotation of the wheels.
P_R_ Square
Robot moves forward 20 centimers
Robot makes a 90 -degree turn
Robot repeats the first two moves until it has moved in a square.
Two ways to write the same thing.
P_R_ touch 360
Robot moves forward 360 degree turn of both wheels when force sensor is pressed.
Two ways to write the same program
P_R_ Turn Around
Robot will move backward for two rotations of both wheels.
Robot will turn around (180 degree turn), so that it is facing the opposite direction it was facing before.
Robot will move forward for one rotation of both wheels.
P_R_ moves plus
forward 50 cm
wait 1 sec
backward 20 cm (so the bot should stop at 30cm)
wait 2 sec
turn right 90 degrees
make a sound
make a second, different sound when touch sensor is pressed
If finished
You can work on properly building the force and ultrasonic sensors and the arm that will be needed for future programs.
To find the build instructions:
Go to the Spike Prime app.
On the START page, click on Build.
Choose Driving Base 2.
If finished
P_R_Triangle
Have your robot make a triangle. Be sure the robot ends in the same position it began. It doesn't matter the length of the sides of the triangle - make them about 20 cm more or less.
Make a sound of your choice
wait 1 sec
Make a different sound of your choice
turn 180 degrees so that the robot is facing the opposite direction.
wait 1second
wait for the touch sensor to be pressed, and then repeat the triangle from this new position
P_R_ Touch Ultra
START POSITION: Robot can be placed at any random distance greater than 15 cm from a wall. ** Ultrasonic sensor on the FRONT must be at least 15 cm away from the wall.**
Robot begins moving when touch sensor is pressed.
Robot moves forward until it is 15cm from the wall.
Stop and wait 1 sec
Move backward until robot is 25 cm from wall. ** You MUST use your ultrasonic sensor for this move.**
P_R_My Ultra <-- try this on your own, but if you are REALLY STUCK, click here.
START POSITION: Robot starts facing the wall, any distance within 10 cm.
Robot backs up until it is 35 cm from the wall and stops **you MUST use your ultrasonic sensor for this**
wait 1 sec
Robot turns 90 degrees to the left
wait 1 sec
Robot backs up 10 cm **you will not be able to use your ultrasonic sensor for this **
6.wait 1 sec
7. Robot turns 90 degrees to the right
8. wait 1 sec
9. Robot moves forward until it is 10 cm from the wall **you MUST use your ultrasonic sensor for this**
If finished
P_R_keep distance
Program your robot to stay 15 cm away from your hand:
If you move your hand closer, it should back up.
If you move your hand away, it should follow.
Or, if finished
P_R_ Song
Set your robot to play different notes at different distances and see if you can get it to play a song
HINT: requires either a loop or simultaneous stacks.
You cannot do P_R_Grab without the accessories. If your accesories are not yet built, build them before continuing.
For this next program, you will need to build the remaining parts from "Driving Base 2"
To find instructions for this build:
open the Spike Prime app
Go to "Build"
Choose and click "Driving Base 2"
Select "Tools and Accessories and begin building from Step 30.
P_R_ Grab
Robot approaches block.
Robot stops just in front of block.
Robot grabs block with arm.
Robot retreats (goes backward) for two rotations of both wheels.
NOTE: ultrasonic sensor often has difficulty detecting distances less than 5 cm, so I do not recommend using distances less than 5 cm.
NOTE: If you ask the motor arm to turn farther than it is actually able to turn, it will not complete the command, which means it will not move on tot he next command, which means it will just get stuck and will not continue with any other commands.
Robot approaches block.
Robot stops just in front of block. (no closer than 10 cm)
Robot grabs block with arm.
Robot waits one second
Robot retreats (goes backward) for two rotations of both wheels.
Wait 1 second
Robot turns around 180 degrees.
Wait one second
Move forward 15cm
Release object.
Back up 1 rotation.
If you are finished:
P_R_ Sing Grab:
Robot can be placed at any random distance from the cuboid.
Robot beeps as it advances toward the cuboid.
Robot beeps faster as it gets closer to the cuboid.
Robot stops in front of the cuboid.
Robot puts arm down over the cuboid and backs up one rotation.
Robot turns around 180 degrees and then lifts the arm.
Robot sings a song of victory - interpret this step as you wish.
ANYTHING BELOW THIS POINT HAS NOT BEEN UPDATED TO SPIKE PRIME
P_R_ Return Grab - for this you will need to have or to build the arm in the front. For instructions, do the following:
** This one is challenging. You will need to use variables, which we have not yet discussed. Try it if you have time.**
Robot approaches block.
Robot grabs block with arm.
Robot retreats to its starting position. **this is the tricky part!
P_R_ touch 360 <-- Click the link for help
Robot moves forward 360 degree turn of both wheels when touch sensor is pressed.
Note : There are several ways to write this program. If you click the link for help, it will show you different ways to write it. All are correct.
If finished : Create your own stacks.
Use either the touch sensor or the light sensor or both and see what you can get your robot to do when the sensors are activated
P_R_ Turn Around
Robot will move backward for two rotations of both wheels.
Robot will turn around (180 degree turn), so that it is facing the opposite direction it was facing before.
Robot will move forward for one rotation of both wheels.
P_R_ moves plus
forward 50 cm
wait 1 sec
backward 20 cm (so the bot should stop at 30cm)
wait 2 sec
turn right 90 degrees
make a sound
make a second, different sound when touch sensor is pressed
P_R_ Back moves
Robot moves forward exactly 55cm, wait one second , then backward 20 cm
P_R_back square
move backward 20cm
wait 1 sec
turn left 90 degrees (make a right angle)
wait 1second
repeat these four commands until the robot has traveled in a square and ends up in the same position it started
P_R_Triangle
As you did with P_R_Back Square, use a loop, but this time, have your robot make a triangle. Be sure the robot ends in the same position it began. It doesn't matter the length of the sides of the triangle - make them about 20 cm more or less.
Make a sound of your choice
wait 1 sec
Make a different sound of your choice
turn 180 degrees so that the robot is facing the opposite direction.
wait 1second
wait for the touch sensor to be pressed, and then repeat the triangle from this new position
Ultrasonic (click link for help)
START POSITION: Robot can be placed at any random distance greater than 15 cm from a wall. ** Ultrasonic sensor on the FRONT must be at least 15 cm away from the wall.**
Robot begins moving when touch sensor is pressed.
Robot moves forward until it is 15cm from the wall.
Stop and wait 1 sec
Move backward until robot is 25 cm from wall. ** You MUST use your ultrasonic sensor for this move.**
RECOMMENDATIONS: Do not use the =
Use the > and the <. If the robot is moving quickly, it may pass the desired distance before registering that it is “=” to the distance. If the robot is moving forward to a desired distance of 15 cm from an object. It should stop as soon as it reaches the smallest distance under 15 if you use “<15”, so it should virtually stop at 15.
How to get to BUILD INSTRUCTIONS for Ultrasonic Sensor:
Open the EV3 Classroom App
Go to "home". If you are already in the app, it is the little house-shaped icon
Go to "Unit Plans"
Go to "Robot Trainer" - (you may have to download it)
Scroll down and click on "Objects and Obstacles"
Look for the panel of instructions on the far right of the screen. Locate the Circle with the right-pointing arrow - click it.
Choose "build"
Choose "Ultrasonic Sensor Driving Base"
P_R_My Ultra
START POSITION: Robot starts facing the wall, any distance within 10 cm.
Robot backs up until it is 28 cm from the wall and stops **you MUST use your ultrasonic sensor for this**
wait 1 sec
Robot turns 90 degrees to the left
wait 1 sec
Robot backs up 10 cm **you will not be able to use your ultrasonic sensor for this **
6.wait 1 sec
7. Robot turns 90 degrees to the right
8. wait 1 sec
9. Robot moves forward until it is 10 cm from the wall **you MUST use your ultrasonic sensor for this**
If finished
P_R_keep distance
Program your robot to stay 15 cm away from your hand:
If you move your hand closer, it should back up.
If you move your hand away, it should follow.
P_R_ Objects <-- click this link for help
Robot can be placed at any random distance greater than 30 cm from a wall
Robot approaches the wall and makes different beeps as it gets closer to the wall.
IMPORTANT: the loop is necessary so that the robot is continually checking for distance. If you do not use the loop, it will make one instantaneous check with the sensor and never check again. It’s like asking you to open your eyes once to look, then close them and not open them again.
Or, if finished
P_R_ Song
Set your robot to play different notes at different distances and see if you can get it to play a song
HINT: requires either a loop or simultaneous stacks.
P_R_ Grab - for this you will need to have or to build the arm in the front. For instructions, do the following:
P_R_ Grab <-- click this link for help
Robot approaches block.
Robot stops just in front of block. (no closer than 5cm)
Robot grabs block with arm.
Robot retreats (goes backward) for two rotations of both wheels.
NOTE: ultrasonic sensor often has difficulty detecting distances less than 5 cm, so I do not recommend using distances less than 5 cm.
NOTE: If you ask the motor arm to turn farther than it is actually able to turn, it will not complete the command, which means it will not move on tot he next command, which means it will just get stuck and will not continue with any other commands.
Robot approaches block.
Robot stops just in front of block. (no closer than 5cm)
Robot grabs block with arm.
Robot waits one second
Robot retreats (goes backward) for two rotations of both wheels.
Wait 1 second
Robot turns around 180 degrees.
Wait one second
Move forward 15cm
Release object.
Back up 1 rotation.
P_R_ Return Grab - for this you will need to have or to build the arm in the front. For instructions, do the following:
** This one is challenging. You will need to use variables, which we have not yet discussed. Try it if you have time.**
Robot approaches block.
Robot grabs block with arm.
Robot retreats to its starting position. **this is the tricky part!
P_R_ Sing Grab:
Robot can be placed at any random distance from the cuboid.
Robot beeps as it advances toward the cuboid.
Robot beeps faster as it gets closer to the cuboid.
Robot stops in front of the cuboid.
Robot puts arm down over the cuboid and backs up to the robot's starting point.
Robot turns around 180 degrees and then lifts the arm.
Robot sings a song of victory - interpret this step as you wish.
P_R_ Line Follow (click link for help)
Program your robot to follow a black line on the challenge board from a given point to a destination.
**If your light sensor does not appear to be getting accurate readings, it may need to be calibrated.
Naming Programs:
Name programs as follows:
P (period number) R ( robot number) + program name
example: P1R8 one rotation would be the correct name for period 1, robot 8 program named "one rotation".
In order to receive credit:
Program must be named correctly
Program must be downloaded and previously tested by student
Program must work correctly
Program is up/visible on computer screen so I can see it as the robot performs
P_R_ one rotation
Robot moves forward for one rotation of both wheels when center button is pressed.
P_R_ 720 turn
Robot turns by moving the left motor (B) 720 degrees.