Barclays Robot Challenge Learn how to Program Robots.
-
Upload
ross-flynn -
Category
Documents
-
view
231 -
download
5
Transcript of Barclays Robot Challenge Learn how to Program Robots.
![Page 1: Barclays Robot Challenge Learn how to Program Robots.](https://reader036.fdocuments.us/reader036/viewer/2022062314/56649f165503460f94c2bf61/html5/thumbnails/1.jpg)
Barclays Robot ChallengeLearn how to Program Robots
![Page 2: Barclays Robot Challenge Learn how to Program Robots.](https://reader036.fdocuments.us/reader036/viewer/2022062314/56649f165503460f94c2bf61/html5/thumbnails/2.jpg)
Why are we here today?● To have fun!
● To learn a bit about how computers control things (a robot)
● To see what we do here at Barclays Technology Centre Radbroke
● To get you to think about whether you might like to learn more about Technology
● There will be people here to help if you get stuck
– There’s no such thing as a stupid question
![Page 3: Barclays Robot Challenge Learn how to Program Robots.](https://reader036.fdocuments.us/reader036/viewer/2022062314/56649f165503460f94c2bf61/html5/thumbnails/3.jpg)
Question….
How likely are you to choose a career in Technology?
A.Definitely notB.MaybeC.DefinitelyD.Not sure
![Page 4: Barclays Robot Challenge Learn how to Program Robots.](https://reader036.fdocuments.us/reader036/viewer/2022062314/56649f165503460f94c2bf61/html5/thumbnails/4.jpg)
Computers● What do you think of when you hear the word “computer”?
![Page 5: Barclays Robot Challenge Learn how to Program Robots.](https://reader036.fdocuments.us/reader036/viewer/2022062314/56649f165503460f94c2bf61/html5/thumbnails/5.jpg)
How about…● Technically, a computer is “a programmable machine”
● So how about…
The thing about computers is that they all need to be programmed to tell them what to do
![Page 6: Barclays Robot Challenge Learn how to Program Robots.](https://reader036.fdocuments.us/reader036/viewer/2022062314/56649f165503460f94c2bf61/html5/thumbnails/6.jpg)
What is a Robot
![Page 7: Barclays Robot Challenge Learn how to Program Robots.](https://reader036.fdocuments.us/reader036/viewer/2022062314/56649f165503460f94c2bf61/html5/thumbnails/7.jpg)
What do we do here at Radbroke
● Barclays Technology Centre, Radbroke is Barclays largest Technology site in the world
● Barclays depends on thousands of different computer systems to run the bank; from making payments, to online banking, to HR and information systems
● 3,500 people work here● Designing, building and supporting all the
bank’s computer systems
![Page 8: Barclays Robot Challenge Learn how to Program Robots.](https://reader036.fdocuments.us/reader036/viewer/2022062314/56649f165503460f94c2bf61/html5/thumbnails/8.jpg)
Todays Plan
Session 1 (9:30/12:30) Robot Programming
Session 2 (10:45/13:45) Break & Site Tour
Session 3 (11:00/14:00) Continue Robot Programming
Roundup and finish (11:55/14:55)
![Page 9: Barclays Robot Challenge Learn how to Program Robots.](https://reader036.fdocuments.us/reader036/viewer/2022062314/56649f165503460f94c2bf61/html5/thumbnails/9.jpg)
Programming a ComputerYou will be writing real computer programs – aka apps!
They will be running on a small computer on the robot called an Arduino
You write your app on the laptop then upload to the robot
The robot then runs on its own… No WiresThe robot has 3 different sensors:
• Ultrasonic – measures distance of object (returns distance)
• Infrared – detects objects (returns True or False)
• Line Follower – detects light (returns Black or White)
![Page 10: Barclays Robot Challenge Learn how to Program Robots.](https://reader036.fdocuments.us/reader036/viewer/2022062314/56649f165503460f94c2bf61/html5/thumbnails/10.jpg)
Getting Started
Open your starter sketch if it’s not already open – its called BRC_Move
Click File -> Open -> Sketchbook – BRC_Move
Your Arduino development app should be open – ask if it’s not
![Page 11: Barclays Robot Challenge Learn how to Program Robots.](https://reader036.fdocuments.us/reader036/viewer/2022062314/56649f165503460f94c2bf61/html5/thumbnails/11.jpg)
Main LoopEach command will be executed on the robot in order
When all commands are executed – it will start from the top of the loop again, and again, and…
The loop is between { and }
That’s it!
![Page 12: Barclays Robot Challenge Learn how to Program Robots.](https://reader036.fdocuments.us/reader036/viewer/2022062314/56649f165503460f94c2bf61/html5/thumbnails/12.jpg)
A function call
Make the robot do something
Tell the robot speed and time
Must have a semicolon at the end
forward(1000,150,150);
Make the robot move forward for 1 second with left and right speed of 150
Then move to the next function
The motors will keep moving until told to stop or some other action
![Page 13: Barclays Robot Challenge Learn how to Program Robots.](https://reader036.fdocuments.us/reader036/viewer/2022062314/56649f165503460f94c2bf61/html5/thumbnails/13.jpg)
Units
TimeAll functions use milliseconds as a unit of time
1000 = 1 second
500 = ½ second
2000 = 2 seconds
SpeedAll functions use a unit of speed between 0 and 255
0 = stop
255 = fastest
Motors tend not to work less than 150
Used to spin and turn
Can help with Obstacle and Line Following
![Page 14: Barclays Robot Challenge Learn how to Program Robots.](https://reader036.fdocuments.us/reader036/viewer/2022062314/56649f165503460f94c2bf61/html5/thumbnails/14.jpg)
Simple Motion
![Page 15: Barclays Robot Challenge Learn how to Program Robots.](https://reader036.fdocuments.us/reader036/viewer/2022062314/56649f165503460f94c2bf61/html5/thumbnails/15.jpg)
IF… THEN… ELSE… with Obstacle Sensors
Use IF
Run your code between { and }
LeftObstacleSensororRightObstacleSensor
If (LeftObstacleSensor() == SENSORON )
{
rightSpin(1000,255);
}
else
{
forward(1000,255, 255);
}
![Page 16: Barclays Robot Challenge Learn how to Program Robots.](https://reader036.fdocuments.us/reader036/viewer/2022062314/56649f165503460f94c2bf61/html5/thumbnails/16.jpg)
With Infra Red Sensor
![Page 17: Barclays Robot Challenge Learn how to Program Robots.](https://reader036.fdocuments.us/reader036/viewer/2022062314/56649f165503460f94c2bf61/html5/thumbnails/17.jpg)
Today Challenges
1 - Obstacle avoid – drive the robot out of the maze (sketch = BRC_Avoid )
2 - Line Follower – set the fastest lap of our race track (sketch = BRC_LineFollow)
Start with basic movement – move and spin (sketch = BRC_Move)
• Make robot move around a square, triangle and circle
Then choose your challenge• There are template sketches that will give you a head
start on the challenges • Load the selected sketch onto the robot and see what it
does• Decide what you need to change to make it work or
improve it