TKC Robot
Loops: repeated tasks with your robot
Before you start
Learn how to get robots to repeat a task over and over again.
Practice using loops
To help you with this section watch the video and do the exercises at this URL: https://studio.code.org/hoc/6
Your Challenge
Using a limited set of blocks ('LEDon', 'LEDoff', wait()', and 'repeat') make the LED on your robot blink on and off continuously (without using the 'BlinkLED13' block).
Applying your learning
Use what you have learned about loops to race your robot in a circular track
Blink my Bot - version 2
Build Your Own Blink
Get the tools
Right-click and save from this URL: http://mrelliott.info/SNAPprograms/BYOblink.xml
Then import the BYOblink project into SNAP. Then open the project from within SNAP.
Test your robot
Test out your robot by pressing the space bar and the 'b' button. What happens?
If you have troubles see the instructions on this link: http://connectmybot.strikingly.com/
Find LED blocks
Click on the orange variables button, scroll to the bottom, click and drag the LED blocks onto the palette.
Find loop blocks
Click on the yellow control button, scroll to the bottom, click and drag the 'wait' and 'forever' blocks onto the palette.
Put it all together
Now put them all together to make the robot blink its LED all by itself.
What happens when you click on the green flag?
Can you make a slow bink? A fast blink? An uneven (long/quick/long/quick) blink?
Why does clicking on the red stop button sometimes leave the LED on, and sometimes leaves the LED off?
Apply your skills
Endurance race robots around the can
Around the can
Using what you have learned in this lesson and 'My Second Program' see how many times your robot can go around the can without going outside the masking tape square.
Your robot can go in any shape you want: lines, squares, triangles, or circles, as long as you stay within the outside boundary square..
No remote control mode allowed!
Contact Us!
To get help building, programming or hosting a workshop:
About THE tKcBOT
'Standing on the shoulders of giants.'
Inspiration
Starting from the UNSW CS4HS bot, many people have given this project a inspirational push, encouraging feedback, opened doors of opportunity, or sustained the project through their enthusiastic participation. Thanks to Susan, BW, Phillip, Adele, Ruth, Stuart and many others.
Technology
Thanks to the explosion of information available on the Internet it is possible to create a robot with amazing capabilities just by bringing together pieces of existing technology with very little original technology. My role has been to marry the inspiration with the the technology available, and to use my experience as a teacher to construct the learning materials to help bring this amazing technology to children. Thanks also, to the helpful people (especially Leo) at Hobart Hackerspace, who have experience and expertise way beyond mine.