- Redesign /resources as sectioned hub with category pages - Migrate 645 Squarespace CDN images to local /images/content/ - Create 9 new news/blog posts with event photos - Fix blog post slugs (rename gibberish filenames) - Rename Design Blog to Design Blogs across site - Remove education page, replace with Platform in nav - Redesign rover repair request form with dynamic rover entries - Add school search combobox to contact, store, and repair forms - Extract shared KNOWN_SCHOOLS data - Make /rover-expansion-3d-printing dynamically pull from MDX - Add related resources sections to product pages - Fix homepage broken /quote links to /store - Store page: sample kit cards, inline quote builder, mailing list opt-in
51 lines
1.9 KiB
Plaintext
51 lines
1.9 KiB
Plaintext
---
|
||
title: "Activity: Binary Bot"
|
||
date: "2022-05-10"
|
||
categories: ["Activities", "All", "Simulator Activities"]
|
||
tags: ["Iteration", "Motors", "Maths", "Intermediate"]
|
||
excerpt: "Complete a simple exercise using only binary numbers!"
|
||
featuredImage: "/images/resources/binary-bot.png"
|
||
---
|
||
|
||
** **
|
||
|
||
Complete the Driving Shapes exercise but using only binary numbers instead of decimal numbers. If you’re unfamiliar with Driving Shapes, all you need to do is program your rover to move in a shape e.g. square or triangle.
|
||
|
||

|
||
|
||
Activity Demonstration
|
||
|
||
### Setup
|
||
|
||

|
||
|
||
#### Learning Binary
|
||
|
||
[**READ MORE**](/resources/learning-binary)
|
||
|
||
All you need is your computer, a Micromelon Rove and a flat, uniform surface to drive it on. If you’re unfamiliar with what binary is check out our Learning Binary post.
|
||
|
||
### Here’s Our Approach
|
||
|
||
You can write a binary number by prefacing 0b before your binary number in python, e.g. 0b100 is 4.
|
||
|
||
The binary number block can be placed in any position a normal number block would go.
|
||
|
||
The convert block located in the utilities category has an option for binary. You can put a normal number block (from the MATH category) into this and convert it to any binary number, this is useful when you want to print out what a normal number would look like in binary.
|
||
|
||
#### **Stage 1**
|
||
|
||
For this solution we repeated the while loop forever so we keep getting a square movement pattern. Then I substituted my binary blocks into the turn degrees and movement blocks.
|
||
|
||
#### To Note
|
||
|
||
Sometimes you’ll need to adjust your angles since the rovers will turn different amounts depending on the surface they are on. See if you can find a really accurate solution with your rover and on the floor in the classroom.
|
||
|
||

|
||
|
||
Example Code
|
||
|
||

|
||
|
||
Example Code
|