mBot: Discrete Guitar (Gr. 6-8)
Using the sensors on the mBot to split continuous data, into discrete data, and playing music along the way.
Turn your robot into an instrument!? Is that possible? Well just like frets on a guitar, which split up the strings into notes, we can do the same thing with the ultrasonic sensor on our robot. This is a useful skill that will bring your coding abilities to the next level.
The mBot has sensor data streaming into it, but sometimes it needs to be controlled, and categorized. This is one important reason students are introduced to the difference between discrete and continuous data. In this lesson, students turn their mBot into an instrument, breaking up the continous sensor data, into discrete notes using if statements and threshold values.
Overall Curriculum Learning Goals
- Discrete and Continuous Data (Lesson Focus)
Overall Coding Learning Goals
- Nested If Statements
- Sensor Inputs
- Intro to Syntactical Programming
- Class 1 - Intro to mBlock, If Statements, and the Ultrasonic Sensor (~30min)
- Class 2 - Nested If Statements and Making Music (~20min)
- Class 3 - Looking Inside the Code (Syntax) (~30min)
Robots and Accessories
- Makeblock Software
- Cardboard/Paper and Tape (optional for instrument customization)