Complete website build including: - Build Your Kit store page with cart system, sectioned layout (Hardware, Software, Attachments, Spare Parts), inline quote request form, and sticky sidebar summary - 16+ pages: Education, Platform, Resources, News, About Us, Download, Contact, Rover, Code Editor, Robot Simulator, etc. - 89+ MDX resource articles and 18 news posts - Store product images scraped from micromelon.com.au - Quote request API route with Airtable integration - Dynamic back links and cover photos on resource pages - Redesigned downloads page - Fixed corrupted MDX code blocks
141 lines
4.0 KiB
Plaintext
141 lines
4.0 KiB
Plaintext
---
|
||
title: "Activity: Survey Bot"
|
||
date: "2021-06-03"
|
||
categories: ["Activities", "All"]
|
||
tags: ["Iteration", "IR", "Motors", "Maths", "Advanced", "Colour Sensors"]
|
||
excerpt: "Learn iteration while using the IR sensors."
|
||
featuredImage: "/images/resources/survey-bot.png"
|
||
---
|
||
|
||
** | **
|
||
|
||
Program the rover to perform a distance survey of the area around it. Have the rover turn on the spot and print out the value of one of the IR distance sensors at intervals around the circle.
|
||
|
||
####
|
||
Relevant Coding Skills
|
||
|
||
Branching
|
||
|
||
-->
|
||
|
||
Iteration
|
||
|
||
Functions
|
||
|
||
Variables
|
||
|
||
-->
|
||
|
||
Algorithm Design
|
||
|
||
-->
|
||
|
||
Maths
|
||
|
||
####
|
||
Relevant Rover Concepts
|
||
|
||
Ultrasonic
|
||
|
||
-->
|
||
|
||
IR
|
||
|
||
Colour
|
||
|
||
Gyroscope
|
||
|
||
Accelerometer
|
||
|
||
Motors
|
||
|
||
LEDs
|
||
|
||
-->
|
||
|
||
Buzzer
|
||
|
||
-->
|
||
|
||
Activity Demonstration
|
||
|
||
### Setup
|
||
|
||
The IR distance sensors have a maximum range of approximately 125cm. If nothing is detected an IR sensor it will read 255.0cm. Place the rover amongst a collection of objects, run the code, and see if a partner can say where the objects were by only reading the distances the robot prints out. This can be done faster by using both IR sensors and only turning 180 degrees.
|
||
|
||
### Here’s Our Approach
|
||
|
||
#### **Stage 1**
|
||
|
||
In our approach, our objective is to get 15 readings from the environment around us. You might use a different number of readings. We will start with a loop block that repeats 15 times. If you’re missing obstacles, try a higher number to collect more readings.
|
||
|
||
**Stage 2**
|
||
|
||
We will need a motor turn by degrees block inside our loop. If we want our robot to have turned a full 360 degree circle once the code has finished running, this block will need to turn one fifteenth of a circle each iteration. After it has run 15 times our rover will have turned a full 360 degrees. We can use a math operation block to divide 360 by 15.
|
||
|
||
#### **Stage 3**
|
||
|
||
Finally we need the rover to print out the IR distance values. The print block will print that IR value to the console.
|
||
|
||

|
||
|
||
Example Code
|
||
|
||
### Related Posts
|
||
|
||
Resources
|
||
|
||
[
|
||
|
||

|
||
|
||
](/resources/creating-a-sumo-unit)
|
||
|
||
[All](/resources?category=All)
|
||
|
||
[Creating A Sumo Unit For Your Digital Technologies Class](/resources/creating-a-sumo-unit)
|
||
|
||
[All](/resources?category=All)
|
||
|
||
How to run a sumo unit in your digital technologies classroom.
|
||
|
||
[Read More →](/resources/creating-a-sumo-unit)
|
||
|
||
[All](/resources?category=All)
|
||
|
||
[
|
||
|
||

|
||
|
||
](/resources/ultrasonic-sensor)
|
||
|
||
[All](/resources?category=All), [Guides](/resources?category=Guides)
|
||
|
||
[The Ultrasonic Sensor](/resources/ultrasonic-sensor)
|
||
|
||
[All](/resources?category=All), [Guides](/resources?category=Guides)
|
||
|
||
Learn all about the ultrasonic sensor!
|
||
|
||
[Read More →](/resources/ultrasonic-sensor)
|
||
|
||
[All](/resources?category=All), [Guides](/resources?category=Guides)
|
||
|
||
[
|
||
|
||

|
||
|
||
](/resources/year-7-digital-tech-at-st-peters)
|
||
|
||
[All](/resources?category=All), [Customer Stories](/resources?category=Customer+Stories)
|
||
|
||
[Case Study: Year 7 Digital Tech at St Peters Lutheran College](/resources/year-7-digital-tech-at-st-peters)
|
||
|
||
[All](/resources?category=All), [Customer Stories](/resources?category=Customer+Stories)
|
||
|
||
See how Meg Foley at St Peters conducted a challenge for their Year 7s using Micromelon.
|
||
|
||
[Read More →](/resources/year-7-digital-tech-at-st-peters)
|
||
|
||
[All](/resources?category=All), [Customer Stories](/resources?category=Customer+Stories)
|