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 program starts
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 (C) 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
What is it supposed to do?
Robot moves forward 360 degree turn of both wheels when force sensor is pressed.
Two ways to write the same program
For this particular program, you DO NEED the force sensor, but you do not need to build the force sensor ONTO the robot. You can do that later.
When finished, do P_R_Turn Around and then work ahead. - SCROLL DOWN
My program will not download!! What now?
Close the Spike Prime app and reopen the app. Try again. This usually works. Also make sure your hub is ON.
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.
My program will not download!! What now?
Close the Spike Prime app and reopen the app. Try again. This usually works. Also make sure your hub is ON.
What to do if you are finished with P_R_Touch 360
Build the force sensor ONTO the bot according to the instructions BELOW.
Create a program that will do the following: Name it P_R_ Hit the Wall
Start moving when you press the touch sensor.
Move forward until it hits a wall no matter how far away from the wall you place it at the beginning.
When it hits the wall, it stops, backs up and turns so that it can move forward again without hitting the same wall.
HINT: You can use commands for the force sensor more than one time in a program.
OPTIONS:
Make it so that it will continue moving forward after it turns away from the wall, and then it will stop and turn again if it hits another wall.
Make it beep, play a song, or flash lights when it hits the wall. Do not ask me how to to this. It is optional at this point, so see if you can figure it out.
Make it do some other option of your choice (dance, maybe?)
Build Instructions for Accessories
My program will not download!! What now?
Close the Spike Prime app and reopen the app. Try again. This usually works. Also make sure your hub is ON.
My program will not download!! What now?
Close the Spike Prime app and reopen the app. Try again. This usually works. Also make sure your hub is ON.
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 distance sensors and the arm that will be needed for future programs.
See above for how to find the instructions.
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 beep sound of your choice (NOTE* do not use the other sounds. They will not work when you unplug your bot from the computer, and your entire program, including sounds, must be able to work when your robot is disconnected.)
wait 1 sec
Make a different beep sound of your choice
turn 180 degrees so that the robot is facing the opposite direction.
wait 1 second
wait for the touch sensor to be pressed, and then repeat the triangle from this new position
P_R_ Touch Ultra
You must have your distance sensor built and plugged in for this one. Look at the program on the right to see which port is should be plugged into. If you need to build it, scroll up to learn how to find the instructions, OR click HERE - it must be built CORRECTLY.
START POSITION: (this is where you place your robot before playing the program): Robot can be placed at any random distance greater than 15 cm from a wall, WITH DISTANCE SENSOR FACING THE WALL. ** Ultrasonic sensor on the FRONT must be at least 15 cm away from the wall.**
What is it supposed to do?
Robot begins moving when touch sensor is pressed.
Robot moves forward until it is 15cm from the wall.
Robot Stops
Robot sits still for 1 second
Robot moves backward until robot is 25 cm from wall.
Robot stops.
** You MUST use your ultrasonic sensor for this move.**
Do NOT use the "exactly at" or the "=", becuase, SADLY, it does not work.
P_R_My Ultra
START POSITION: Robot starts facing the wall, any distance within 10 cm. This means it is 10cm or CLOSER to the wall.
What is it supposed to do?
Robot backs up until it is 35 cm from the wall
Robot STOPS **you MUST use your ultrasonic sensor for this**
Robot sits still for 1 second
Robot turns 90 degrees to the left ** Do not type "90" into your code block. Typing 90 into your code block tells the WHEEL to turn 90 degrees. You want the ROBOT to turn 90 degrees.**
Robot sits still for 1 second
Robot backs up 10 cm **you will not be able to use your ultrasonic sensor for this ** - you will need to instruct the robot to move back 10 cm.
6. Robot sits still for 1 second
7. Robot turns 90 degrees to the right **again, do not type 90 into your code block** - see above in step 4.
8. Robot sits still for 1 second
9. Robot moves forward until it is 10 cm from the wall **you MUST use your ultrasonic sensor for this**
10. Robot stops.
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.
If you are running out of time, you can use any object that is about the same size as the block, and you can use the wall instead of the upright panel. You just need an object that the robot can lower its arm over and drag.
P_R_ Grab
Begin with the robot's arm raised. START with the robot about 30 cm from the block. The distance does not need to be exact. The block must be set up as shown in the picture just above with the block in front of a wall OR in front of the upright, black Lego panel.
Robot approaches block.
Robot stops just in front of block.
Robot lowers arm and traps 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 to the 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_Avoid Obstacles
This is a challenge tadk that gives you some freedom and creativity.
For this challenge program set up your own situation in which your robot needs to FIND and COLLECT a block.
Then have the robot move the block to a predetermined location, HOWEVER, you need to place an obstacle in its path that it needs to avoid in order to get to that target location.
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.