# Makey:bit Brand New Eyes!!

less than 30 min

ages 11-13

## What Will You Make?

This project shows how to control the color of the Makey:bit’s eyes and write a program to randomly change the eye color every time you shake the Makey:bit + micro:bit.

## What Will You Learn?

Learn how to control the Makey:bit eyes by learning about programmable, addressable LEDs controlled by the NeoPixel driver.

Learn how to install Extensions in MakeCode.

Learn how to use math blocks in MakeCode.

## What are the Makey:bit eyes?

#### Neopixels

The eyes of the Makey:bit are NeoPixel-compatible Light Emitting Diodes (LED) that can be individually programmed. Each eye has a Red, Green and Blue (RGB) LED and the brightness and intensity of each color can be controlled through code. Multiple Neopixels can also be put together on a strip or grid and can be individually controlled based on the order they are on the strip (starting with 0 through however many NeoPixels we have).

## Adding NeoPixel Extension

#### Step 1

Neopixels are not standard with every micro:bit so first step is to add the blocks needed to control them in MakeCode. In programming, blocks of code that are used for a specialized purpose are often called “drivers” or “libraries.” In MakeCode, we can add new drivers and libraries by going to a section called “Extensions.”

#### Step 2

Open your beating heart program in MakeCode. Click on the “Advanced” tab in the code blocks section.

#### Step 3

Scroll to the bottom of the blocks and click on “Extensions”

#### Step 4

On the top row there is a square for the Neopixel drivers, click on it.

## Program the Eyes

#### Step 1

Now you should be back in the MakeCode programming environment and a new tab should be visible called “Neopixel”.

#### Step 2

First you have to tell the micro:bit that NeoPixels are connected to it. Click on the Neopixel tab and drag the “set strip…” block to the “on start” block. On the Makey:bit, the NeoPixels are connected to pin 16 so select P16 and since there are two eyes, select “2” LEDs.

#### Step 3

NeoPixels are very bright when on full (default) so it is recommended to use the “set brightness” block to set the brightness to roughly half (they can go from 0-255 so 100 is a good starting point).

#### Step 4

Now that the micro:bit knows that there are NeoPixels connected. Let’s turn on the colors. Use the “strip set pixel color…” block and put it inside the forever loop.

Remember, the NeoPixels start at 0 so even though there are two Neopixels, the first one (left) is “0” and the second one (right) is “1”.

Don’t forget to use the “show” block otherwise nothing will happen.

#### Step 5

Upload the program.

## Random Color Generator

#### Step 1

Neopixels make colors by combining red, green and blue.

On the “more” menu of the Neopixels tab, there’s a block that lets us make our own colors by combining them ourselves.

In this block, 0 is “off” and 255 is maximum brightness. When all are at 255, the color looks white. When only one color is on, the color is that color… etc.

You can drag this block where the color name is currently showing and make your own colors by changing the values directly.

#### Step 2

If you want to explore how many colors the NeoPixels can make, you could do it manually but that would take a long time. Instead, let’s explore an alternative approach.

#### Step 3

Now is a good time to explore the “Math” blocks. Click on that tab and select the the “Random” block.

If you put in a random number between 0-255 into the value, now, every time the heart beats, a new random number and color will appear.

Upload the code and observe how the Makey:bit functions.

#### Sample Code

Link to MakeCode: https://makecode.microbit.org/_6k7dUThyPLo2

**Note:** In the sample code there’s an additional math step where we pick a random number between 1-25 and then multiply the number by 10… Can you guess why that was done?

## What Is Happening Here?

#### Intro to Makey:bit

This is an introductory programming project for the Makey:bit that explains how to add extensions and program features of the Makey:bit.

This is also an introductory project to explore how colors are most commonly generated in most computer screens, through a combination of “RGB” (Red, Green and Blue) Lights. The Makey:bit eyes are RGB LEDs and the final code will generate thousands of different colors by changing the level of Red, Green or Blue in the eyes.

## About the Makey:bit

The Makey:bit Adventure Board is the perfect way to get started with microcontrollers. With this exclusive Maker Shed kit, you’ll be able to easily launch into the world of electronics and create amazing projects.

This all-in-one board includes everything you need to get started, including a built-in LED, buzzer, and various sensors. Plus, the Makey:bit is compatible with all kinds of additional modules, so you can easily expand your creativity.

So what are you waiting for? Get the Makey:bit Adventure Board today and start supercharging your microcontrollers!

Are you looking for a way to supercharge your microcontrollers? If so, then you need the Makey:bit Adventure Board! This exclusive Maker Shed product is packed with features that will take your microcontrollers to the next level. With the Makey:bit, you’ll be able to launch into the realm of microcontrollers and unleash their full potential. The Makey:bit is loaded with features that make it an essential tool for anyone looking to get the most out of their microcontrollers.

**Materials:**

- Makey:bit board
- micro:bit board
- 3 AA Batteries

#### See More Projects in these topics:

Electronics Engineering Microcontrollers Robotics STEM or STEAM#### See More Projects from these themes:

Construction Site The Shop (Makerspace)## Maker Camp Project Standards

#### Based on NGSS (Next Generation Science Standards)

*The Next Generation Science Standards (NGSS) are K–12 science content standards. Learn more.*Forces and Motion 3-PS2-3. Ask questions to determine cause and effect relationships of electric or magnetic interactions between two objects not in contact with each other. HS-PS4-5. Communicate technical information about how some technological devices use the principles of wave behavior and wave interactions with matter to transmit and capture information and energy.

**CCSS (Common Core State Standards)**

*The Common Core is a set of high-quality academic standards in mathematics and English language arts/literacy (ELA).*Measurement & Data

**Grades K-2**CCSS.MATH.CONTENT.K.MD.A.1 Describe measurable attributes of objects, such as length or weight. Describe several measurable attributes of a single object. CCSS.MATH.CONTENT.1.MD.A.1 Order three objects by length; compare the lengths of two objects indirectly by using a third object. CCSS.MATH.CONTENT.1.MD.A.2 Express the length of an object as a whole number of length units, by laying multiple copies of a shorter object (the length unit) end to end; understand that the length measurement of an object is the number of same-size length units that span it with no gaps or overlaps. CCSS.MATH.CONTENT.2.MD.A.1 Measure the length of an object by selecting and using appropriate tools such as rulers, yardsticks, meter sticks, and measuring tapes. CCSS.MATH.CONTENT.2.MD.A.2 Measure the length of an object twice, using length units of different lengths for the two measurements; describe how the two measurements relate to the size of the unit chosen. CCSS.MATH.CONTENT.2.MD.A.3 Estimate lengths using units of inches, feet, centimeters, and meters. CCSS.MATH.CONTENT.2.MD.A.4 Measure to determine how much longer one object is than another, expressing the length difference in terms of a standard length unit.

**Grades 3-5**CCSS.MATH.CONTENT.3.MD.B.3 Draw a scaled picture graph and a scaled bar graph to represent a data set with several categories. Solve one- and two-step "how many more" and "how many less" problems using information presented in scaled bar graphs. CCSS.MATH.CONTENT.4.MD.A.1 Know relative sizes of measurement units within one system of units including km, m, cm; kg, g; lb, oz.; l, ml; hr, min, sec. Within a single system of measurement, express measurements in a larger unit in terms of a smaller unit. CCSS.MATH.CONTENT.4.MD.C.5 Recognize angles as geometric shapes that are formed wherever two rays share a common endpoint, and understand concepts of angle measurement. CCSS.MATH.CONTENT.5.MD.A.1 Convert among different-sized standard measurement units within a given measurement system (e.g., convert 5 cm to 0.05 m), and use these conversions in solving multi-step, real world problems. CCSS.MATH.CONTENT.5.MD.C.3 Recognize volume as an attribute of solid figures and understand concepts of volume measurement. Ratios & Proportional Relationships

**Middle School**CCSS.MATH.CONTENT.6.RP.A.1 Understand the concept of a ratio and use ratio language to describe a ratio relationship between two quantities. CCSS.MATH.CONTENT.6.RP.A.3 Use ratio and rate reasoning to solve real-world and mathematical problems, e.g., by reasoning about tables of equivalent ratios, tape diagrams, double number line diagrams, or equations. CCSS.MATH.CONTENT.7.RP.A.1 Compute unit rates associated with ratios of fractions, including ratios of lengths, areas and other quantities measured in like or different units. CCSS.MATH.CONTENT.7.RP.A.2 Recognize and represent proportional relationships between quantities.

*The K–12 Computer Science Framework is designed to guide computer science from a subject for the fortunate few to an opportunity for all.*The guiding practices include: Fostering an Inclusive Computing Culture Collaborating Around Computing Recognizing and Defining Computational Problems Developing and Using Abstractions Creating Computational Artifacts Testing and Refining Computational Artifacts Communicating About Computing You can download the complete framework here. You may also want to consider the International Society for Technology in Education Standards. The ISTE Standards provide the competencies for learning, teaching and leading in the digital age, providing a comprehensive roadmap for the effective use of technology in schools worldwide.

**ISTE Standards (International Society for Technology in Education)**

*The ISTE Standards provide the competencies for learning, teaching and leading in the digital age, providing a comprehensive roadmap for the effective use of technology in schools worldwide.*

**1.1 Empowered Learner**

**Summary:**Students leverage technology to take an active role in choosing, achieving, and demonstrating competency in their learning goals, informed by the learning sciences. 1.1.a Students articulate and set personal learning goals, develop strategies leveraging technology to achieve them and reflect on the learning process itself to improve learning outcomes. 1.1.b Students build networks and customize their learning environments in ways that support the learning process. 1.1.c Students use technology to seek feedback that informs and improves their practice and to demonstrate their learning in a variety of ways. 1.1.d Students understand the fundamental concepts of technology operations, demonstrate the ability to choose, use and troubleshoot current technologies and are able to transfer their knowledge to explore emerging technologies.

**1.2 Digital Citizen**

**Summary:**Students recognize the rights, responsibilities and opportunities of living, learning and working in an interconnected digital world, and they act and model in ways that are safe, legal and ethical. 1.2.a Students cultivate and manage their digital identity and reputation and are aware of the permanence of their actions in the digital world. 1.2.b Students engage in positive, safe, legal and ethical behavior when using technology, including social interactions online or when using networked devices. 1.2.c Students demonstrate an understanding of and respect for the rights and obligations of using and sharing intellectual property. 1.2.d Students manage their personal data to maintain digital privacy and security and are aware of data-collection technology used to track their navigation online.

**1.3 Knowledge Constructor**

**Summary:**Students critically curate a variety of resources using digital tools to construct knowledge, produce creative artifacts and make meaningful learning experiences for themselves and others. 1.3.a Students plan and employ effective research strategies to locate information and other resources for their intellectual or creative pursuits. 1.3.b Students evaluate the accuracy, perspective, credibility and relevance of information, media, data or other resources. 1.3.c Students curate information from digital resources using a variety of tools and methods to create collections of artifacts that demonstrate meaningful connections or conclusions. 1.3.d Students build knowledge by actively exploring real-world issues and problems, developing ideas and theories and pursuing answers and solutions. 1.4 Innovative Designer

**Summary:**Students use a variety of technologies within a design process to identify and solve problems by creating new, useful or imaginative solutions. 1.4.a Students know and use a deliberate design process for generating ideas, testing theories, creating innovative artifacts or solving authentic problems. 1.4.b Students select and use digital tools to plan and manage a design process that considers design constraints and calculated risks. 1.4.c Students develop, test and refine prototypes as part of a cyclical design process. 1.4.d Students exhibit a tolerance for ambiguity, perseverance and the capacity to work with open-ended problems.

**1.5 Computational Thinker**

**Summary:**Students develop and employ strategies for understanding and solving problems in ways that leverage the power of technological methods to develop and test solutions. 1.5.a Students formulate problem definitions suited for technology-assisted methods such as data analysis, abstract models and algorithmic thinking in exploring and finding solutions. 1.5.b Students collect data or identify relevant data sets, use digital tools to analyze them, and represent data in various ways to facilitate problem-solving and decision-making. 1.5.c Students break problems into component parts, extract key information, and develop descriptive models to understand complex systems or facilitate problem-solving. 1.5.d Students understand how automation works and use algorithmic thinking to develop a sequence of steps to create and test automated solutions.

*The Next Generation Science Standards (NGSS) are K–12 science content standards.*MS-ETS1-1. Define the criteria and constraints of a design problem with sufficient precision to ensure a successful solution, taking into account relevant scientific principles and potential impacts on people and the natural environment that may limit possible solutions. MS-ETS1-2. Evaluate competing design solutions using a systematic process to determine how well they meet the criteria and constraints of the problem. MS-ETS1-3. Analyze data from tests to determine similarities and differences among several design solutions to identify the best characteristics of each that can be combined into a new solution to better meet the criteria for success. MS-ETS1-4. Develop a model to generate data for iterative testing and modification of a proposed object, tool, or process such that an optimal design can be achieved. For additional information on using content standards with our projects please visit the Maker Camp Playbook.