LEGO SPIKE Prime Parcel Scanning Robot
Skills:
AI Pair Programming60%
Key Takeaways
Builds a parcel scanning robot using LEGO SPIKE Prime
Full Transcript
we have a challenge today okay this is the last lesson for our intermediate robots on right so we have a robot which is going to be pretty cool okay when the motor is moving the cores will close and it will also lift up the sample towards the sensor okay so if you have a look at this we got to put my sample over here so it can turn around and then we can lower the motor and then after you lower the motor in automatically it mechanically opens the arms as well okay then when we close the motor when we rotated the other way it's going to lift up the sample towards the color sensor I just dropped my sample all right so that was just me moving it with my hands but here is my challenge for you okay good designed the code so that it lifts up its arms so that it doesn't knock over the sample when it turns around this up its arm turns around to the left and then lifts up the the sample it's neither going to be yellow or purple if it's yellow I wanted to show a smiley face and then put it into the blue box it's purple I want you to show a sad face and then put it into the blue box okay so that is our challenge today alright so this is now dropping the sample so the opposite is lifting the sample so what I want to do is I create a my block one is called lifts and one is called drop okay so drop will be the first one you and then the second one is going to be whole lift we always want to create my Bluffs because it's more readable for us it's much easier to read what drop does and what lift does then to care about you know is it rotating anti-clockwise or clockwise and yeah yeah all right so here we go drop is this butt lift is going to be the opposite okay so we're going to lift going this way so now please who remembers what what initialization is for a robot who has heard of the word initialization well what we do at the start of the robots program to make sure that it always starts in the same position and for the our initialization for this robot what we want to do is two things first of all we want to lift its arms okay we want to lift its arms up so that we're not going to accidentally knock over these two samples okay so that's step one is to lift our arms step two is to make it so that we spin our arm around so that we are facing the middle here whether with the blue gap okay so the two steps for initialization is lift the arms and then to move so that we are facing the gap okay so let's try that so I'm going to create a new my block bolt in it which is short for initialization you okay I say that what is initialization going to do initialization was two things right you it was firstly we lift the up second thing is we move the large motor so large motor is motor ain't to the middle so we go to movement and then we go I know we're going to motors up the top so we go a shortest path to position zero what that will do is it will force the motor to start with it positions urine and when we use the shortest path command inmates us so that it doesn't matter which way it was turned it will always turn there at the shortest angle possible and then when we run the code we have to run the init code yeah then we go in it okay and then when you run the code it should start with your robot arm looking up facing the middle okay even if I if I change it if I change the way that the arm arm is positioned for example and then I change the way that the arm is facing as well if I run the Enigma code it's all going to return back to normal see so we got to make sure that the robot is always starting in the same position that's called robot initialization another thing I've just noticed is that when it spins its arm around it's still very very quick so I'm going to step motor a speed to be slower as well central a speed 20 you now I can test my initialization code again starting with my robot arm spacing all all strange directions but then as soon as I run my initialization code it should return back to normal thing is we can turn it all the way to the side and not care about the angle because we just want to turn it all the way to the limit because our robot is already designed so that it mechanically stops ourselves from turning so let's experiment with motor a so we can go run motor a for two seconds and then see what direction clockwise is it's going to initialize then run clockwise so that's going to turn to the right hand side I'm going to do the left hand side first so let's try this one again so anti-clockwise goes to the left so first it's going to initialize and then it goes to the left now what we do is we drop it and lift it so we go into my blocks and then we add a drop to drop our arms and then lift to lift the sample all right so let's have a go and see if our robot is going to do what we asked it to do this is going to initialize and then turns around and blocks yeah and then lifts the arm cool and the next really cool thing is that you notice here on our on our code is that is that the over here on our point view for our color sensor it's already sensing the color it's sensing that it's purple which is fantastic which is exactly what we wanted because after we see that it is purple we want to show that in smiling so here we go control and actually I'll create a another my block called scan we went to skim to see what did what it is and then do something with it okay my blocks credible and cold scan you and then we run a scan after we lift up the block we'll do an if/else block if our sensor is sensing the color pebble you then we're going to show a frown you for two seconds you you like this you but shone round for two seconds but otherwise well a smile for two seconds so there we go after we lived then we skinned so after we scan and we do the same thing we return to the middle and we drop so we can go motor motor a shortest path to zero and then we drop all right so let's try this code so first let's go to initialize go to the left pick up my purple sample show the frowny face and then drop it it works is good now we got to do the full thing so we grab the sample on the left skin and then drop it and then grab the sample on the right and also scan and drop it and then for lift I feel like it's it's a bit too hard so I'm gonna switch it to fifteen percent so that it doesn't get knocked out of my hand then I'll try again you you you [Music] I'd say initialize whoops because it's neat to lift it below that's why so that's the problem with the lift if I finally turn it slower I also have to turn more as a more time so I'll have to adjust that I go back into here and then let's see how it's handy now with our with our my blocks because if I didn't have my blocks then changing it like this would take a lot more time alright let's try it now you you initialize go to the left click up the first bit smiley face and it swapped it and goes to the second one loose it up sad face so now this is a successful run of our automated code
Original Description
Enjoy this preview of the Robotics course from Creator Academy.
In this video:
Learn how to use My Blocks for easy program readability.
Learn about robot initialisation.
Taken from the LEGO SPIKE Prime unit "Kickstart a business" - this robot is designed to pick up and scan parcels to determine behaviour.
Build your own robot from the instructions here: https://education.lego.com/en-au/support/spike-prime/building-instructions
For more in-depth science, building and coding on this subject, visit www.creatoracademy.com.au
LEGO® is a trademark of the LEGO Group of companies which does not sponsor, authorise, or endorse this video.
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Creator Academy Australia · Creator Academy Australia · 48 of 60
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
▶
49
50
51
52
53
54
55
56
57
58
59
60
LEGO Wedo 2.0 Kangaroo and Joey Demonstration
Creator Academy Australia
LEGO Wedo 2.0 Koala Demonstration
Creator Academy Australia
LEGO WeDo 2.0 Eagle vs Rabbit Demonstration
Creator Academy Australia
Animatronic Australia: The Kangaroo
Creator Academy Australia
How Semiconductors Work: 3D Animation
Creator Academy Australia
LEGO Wedo 2.0 Koala
Creator Academy Australia
First impressions and unboxing First Lego League: Into Orbit 2018
Creator Academy Australia
FLL Into Orbit Team Ranking Gears talks about Artificial Gravity
Creator Academy Australia
FLL Into Orbit team Ev3lution discusses isolation in space
Creator Academy Australia
PI3-BOT (Pie Bot) Prototype
Creator Academy Australia
Dynamic display stand for LEGO Bugatti Chiron (preview)
Creator Academy Australia
Creative Kids TV announcement featuring Creator Academy
Creator Academy Australia
LEGO WeDo 2.0 Guided Lesson: Milo
Creator Academy Australia
LEGO SPIKE PRIME: Turtle Prime Demonstration
Creator Academy Australia
LEGO SPIKE PRIME "Wheelchair Prime"
Creator Academy Australia
10 Reasons why EV3 is SUPERIOR to SPIKE Prime
Creator Academy Australia
Your first launch after installing Python: Python for Kids Webinar Highlight
Creator Academy Australia
What is "Sharpening the Saw": Python for Kids Webinar Highlight
Creator Academy Australia
Why We Use Comments: Python for Kids Webinar Highlight
Creator Academy Australia
Build a Scratch Dinosaur Park (Full Lesson)
Creator Academy Australia
Scratch 3.0: Cat and Mouse Game Stream (Krunal)
Creator Academy Australia
Python Tutorial: Make a Toilet Paper Calculator (Full Lesson)
Creator Academy Australia
Scratch 3.0 Tutorial: Making a chatbot that plays 'heads or tails' (Full Lesson)
Creator Academy Australia
Getting Started with MicroPython on SPIKE PRIME (old)
Creator Academy Australia
Easter Egg Game Tutorial in Scratch (Full Lesson)
Creator Academy Australia
Accessing Weather API with Python (Highlights)
Creator Academy Australia
Accessing Translate API with Python (Highlights)
Creator Academy Australia
Scissors, Paper, Rock with Scratch 3.0 (Highlights)
Creator Academy Australia
Making a really scary game with Scratch 3.0 (Highlights)
Creator Academy Australia
Making a Lemmings game with Scratch 3.0 (Highlights)
Creator Academy Australia
Space Navigation Game in Scratch (Highlights)
Creator Academy Australia
Scratch Supercat Game (Full Lesson)
Creator Academy Australia
Introduction to Robots with LEGO Wedo 2.0 (Full Lesson)
Creator Academy Australia
Getting Started With LEGO Spike Prime (Full Lesson)
Creator Academy Australia
Scratch Walk Cycle Animation Tutorial (Full Lesson)
Creator Academy Australia
Building a Scissor Lift with LEGO Simple Machines (Highlights)
Creator Academy Australia
EV3 datalogging RPM challenge (highlights)
Creator Academy Australia
Learning about buses with LEGO (Full Lesson)
Creator Academy Australia
Make "Flappy Bird" in Scratch 3.0 (Highlights)
Creator Academy Australia
"Memory Arrows" game with Scratch 3.0 Lists (Highlights)
Creator Academy Australia
Learning about Gear Ratios with LEGO Simple Machines (Highlights)
Creator Academy Australia
Scratch 3.0 Bouncing Ball with Stretch, Speed and Acceleration (Full Lesson)
Creator Academy Australia
LEGO SPIKE Prime Order Tracking Robot (Highlights)
Creator Academy Australia
Scratch 3.0 Race Guesser (Full Lesson)
Creator Academy Australia
How Banks Work - a quick explanation for kids
Creator Academy Australia
SPIKE Prime Safe + importance of passwords (Highlights)
Creator Academy Australia
Combination Safe Coding Guide with LEGO SPIKE Prime
Creator Academy Australia
LEGO SPIKE Prime Parcel Scanning Robot
Creator Academy Australia
Building "Addy" the Addition Chatbot
Creator Academy Australia
SPIKE 2.x PID Balancer with Scratch for SPIKE Prime / 51515: Gyro Girl
Creator Academy Australia
What is Procedural Programming
Creator Academy Australia
Zombie game in SCRATCH (plus horrifying zombie facts!)
Creator Academy Australia
Swarming Bugs Scratch Game
Creator Academy Australia
LEGO Mindstorms/SPIKE Prime Scanner and Printer
Creator Academy Australia
Fishing Game with SCRATCH (For Fathers Day!)
Creator Academy Australia
Measuring Paper Plane Speed with SPIKE Prime Line Graphs
Creator Academy Australia
Comparing Mindstorms Robot Inventor and SPIKE Prime
Creator Academy Australia
Code a 'Knock Knock Joke' game in Scratch 3.0
Creator Academy Australia
Creator Academy Australia Live Stream
Creator Academy Australia
Discovering LEGO Mindstorms/SPIKE Gyro Pitch Deadzone
Creator Academy Australia
More on: AI Pair Programming
View skill →Related Reads
🎓
Tutor Explanation
DeepCamp AI