Advancing via MUzECS Platform

From REU@MU
Jump to: navigation, search

Researchers: Gustavo Gratacós and Sam Olson

Mentor: Dennis Brylow

Background

The MUzECS hardware: A custom shield which fits an Arduino Leonardo or Uno.

MUzECS is a platform that engages high school students to learn how to program through a block based programming language and music. Students are presented with a microcontroller unit that houses an ultrasonic distance sensor, four buttons, LED lights, and a speaker. This allows students to program a mini-piano, a theremin, their own autonomous songs, and many other things. Students achieve this by using a custom block-based programming language. The MUzECS software has three distinct versions, one that runs locally on all major platforms, another version that runs on a remote server through a Chrome App, and a Chrome App version that runs locally. The last version is currently in progress.

This project currently has several competitors, like the Adafruit Circuit Playground. However, many of the competitors either require constant online connectivity or are very expensive. Therefore, this project is well-suited for high schools with low resources and high schools that do not have constant online connectivity.

Research Question

Adafruit's Circuit Playground Classic is cheaper than the MUzECS hardware. However, its software runs on a server and requires constant connection, which is not always available for high schools with low resources. Therefore, it would be beneficial to get the Circuit Playground to work with the MUzECS software, providing us with the convenience of offline programming and cheap hardware. This leads us to the question: Can we get the MUzECS software to work with Adafruit's Circuit Playground?

Adafruit's Circuit Playground board.

Goals

Our requirements to fulfill this research are to:

  1. install firmata to MUzECS. Firmata is a prerequisite to get Circuit Playground to connect to the MUzECS software.
  2. establish a connection between Adafruit's Circuit Playground's firmata and the MUzECS software.
  3. add functionality for Circuit Playground's I/O.

Getting MUzECS to Install Firmata to Circuit Playground

Firmata is a program that allows you to manipulate all of the peripherals of the board through serial communication. That is, once Firmata is installed on the Circuit Playground board, we can make it turn on LEDs, use its sensors, etc. by just sending serial commands to the board. Having Firmata installed on the board is required for the MUzECS software to communicate with said board. Therefore, our first step is to make the MUzECS software install Firmata into the Circuit Playground board.

To install Firmata on the board, the MUzECS software uses a nodejs library called "avrgirl-arduino," this library uploads compiled files into boards. Although "avrgirl-arduino" supports the orignal MUzECS board by default, the Circuit Playground is not supported, so we need to modify the library in order to add support for the Circuit Playground.

Establishing a Connection

After Firmata is installed on the Circuit Playground, communicating with the Circuit Playground is expected to be the same as communicating with the MUzECS board. However, some things have to be modified. The code to reset the board and run new software does not work by default. On top of this, a new library is needed to properly use the Circuit Playground's sensors. This library, "playground-io", needs to be deployed on the user's environment for it to run.

Adding Functionality for Circuit Playground's I/O

Our last step is to add blocks for each of the Circuit Playground's peripherals. For instance, we need to add a new block for the multicolor LEDs, remove the blocks for the MUzECS board's ultrasonic sensor, etc. This can be difficult, not only because the Circuit Playground is very different from the existing MUzECS board, but also because the blocks need to represent the existing Arduino C code. Meanwhile, the libraries we're using for the Circuit Playground use event based Javascript code. Making Javascript code look like C code in such a way that students can easily understand it can be challenging.

Future Work

Since the start of the summer, many potential research questions and things worth looking into have popped up. For future reference to ourselves and anyone who is interested in working on MUzECS, here they are:

Adafruit's Circuit Playground Express

There is a new version of the Circuit Playground board. This one has an ARM processor and works very differently from the previous iteration. We are mainly interested in this board because it uses Microsoft's Makecode. Makecode is an editor based on blockly that works offline. We suspect that it works on Chromebooks because the Circuit Playground express is recognized by computers as an ordinary drive. Potential questions are:

  • Can we add support for the Circuit Playground Express on the MUzECS software?
  • Will our curriculum benefit from this?
  • Will the "Circuit Playground Express community" benefit from this? As they do not have a curriculum for their current software.
  • Are boards like this, which are recognized as drives in a computer, better suited for offline programming in the browser?
  • Microsoft Makecode uses the browser's cache for its offline functionality. It works on other browsers aside from Chrome. Can MUzECS be made to do this?

micro:bit

micro:bit is a small board that was featured in the last "Blocks and Beyond" conference. Like the Circuit Playground express, it also has an ARM processor and Microsoft Makecode support. However, micro:bit has several other editors that support it. There is an interactive text based editor that leads the student through the coding, a Python editor, and a Javascript editor that has integrated tutorials. Furthermore, it is also cheaper than the Circuit Playground Express and it has 11 lessons to accompany the board. These lessons have a 5 minute lesson plan and notes for teachers. Needless to say, many of the research questions that apply to the Circuit Playground Express apply to this board as well.

MUzECS Language Design

Most of the development concerning the MUzECS platform has focused on adding, improving, and fixing features. Therefore, the block-based interface itself hasn't received much attention in terms of design. The design of the dialect has either been based on intuition, or other existing block-based interfaces. This leads us to the question: How can the MUzECS dialect be improved on the basis of learnability? Can the dialect be improved using empirical data?

The end goals of this project would consist in the following:

  • to create the standard MUzECS dialect, to which future workers will adhere
  • to back up every design decision with empirical data from Milwaukee schools using MUzECS, other schools, and other research

Arduino Code Generation

The code generated by the MUzECS software is in Javascript. The code is very complex and does not closely resemble the code that is generated by the blocks, as it has promises, events, async functions, etc. Needless to say, the generated code is not a good introduction to students who want to transition to text based programming. Furthermore, the design of the blocks-based language is based on the Arduino language, not Javascript. How do we display text-based code that students can understand?

An idea would be to generate Arduino code and display it to the students. Meanwhile, the Javascript code could be hidden and run on the background. Other blocks-based environments, like Makecode and Applab, do something similar. They only display the code that is completely necessary for students to understand, and hide the rest.

References

  1. A Browser-based IDE for the MUzECS Platform
  2. Avrgirl-Arduino Github repository
  3. Code.org's CS Discoveries
  4. Johnny-Five - Javascript library that allows you to communicate with Firmata
  5. Learnable programming: blocks and beyond - A paper on the learnability of block-based languages.
  6. micro:bit's official webiste
  7. MUzECS: Embedded blocks for exploring computer science
  8. Pushing Blocks all the way to C++ - This paper, published in 2015 Blocks and Beyond, has information on the micro:bit.