> 
 > 
2. Virtual Classroom Basics for Students
Micro:bit Coding with Una's MakeCode
Micro:bit Coding with Una's MakeCode

This documentation guides students on using Una’s MakeCode coding editors and micro:bit simulator, covering code writing and submission, Hex file management, and adding extension blocks.

Different Types of Una’s MakeCode Coding Editors

Una virtual classroom embeds the original and modified versions of Microsoft MakeCode for students to create micro:bit devices and AI apps, enabling students to create different powerful and innovative products using the same type of block codes.

Type 1: Micro:bit programs

The original Microsoft MakeCode, designed for micro:bit education, is embedded in Una’s virtual classroom, enabling students to develop micro:bit programs using block-based coding. This document primarily focuses on this type of Una’s MakeCode environment.

Type 2: AI Apps

Details: Develop AI apps with Una’s MakeCode

Zoom in or out in coding workspaces

You can adjust the size of the coding space to make completing your task easier. 

Code in individual coding space

This first coding tab is designed for individual coding. Just like the original MakeCode, you can drag blocks out or write your own program in your own coding space.

Besides, you may duplicate codes in this coding space. Place your mouse onto the block you want to copy. Click your right mouse button, and click “duplicate”.

Get sample code provided by teachers

The fourth coding tab is Sample Code, which is a view-only space that shows the sample code provided by teachers and given to students as a reference / starting point / tips of this task. If teachers have provided a sample code, students can click on the “sample code” tab to view it.

If you want to copy the sample code into your personal coding space, you can follow the steps below. 

Copy and paste codes in the same or different coding spaces.

Import and export functions are designed in all coding spaces and history on Una. This function allows students to copy and paste code blocks.

  1. Export: a) To export all blocks in a coding space, place your mouse at a blank part of the coding space. Click your right mouse button, and click “export all blocks.” b) To export a singular block, place your mouse on the block you wish to copy. Click your right mouse button, and click “export”.
  2. Copy code by XML: You will see the export window pop out. Click the “copy” button, then click the “close” button. The block code in XML is saved in your operating system’s clipboard.
  3. Import: In any coding space where you want to paste the code, right-click your mouse on the empty space and click the “import” button. The import window pop out.
  4. Paste code by XML: Right-click your mouse and click “paste” to paste the XML code from your operating system’s clipboard.
  5. Completion: Press the “import button”. Click the “close” button to close the popup window. You will see the block codes in the coding space.

Observe group member’s code in real-time

The second coding tab is your groupmate’s workspace. By clicking on the “view groupmate” tab and selecting a group member’s name, you can observe their coding interface in real-time. This feature is essential for effective collaboration, as it allows you to provide immediate feedback, ensure consistency across the project, and learn from each other’s coding practices.

Collaborative coding in group workspace

The third coding tab is the Group workspace, enabling group members to edit code collaboratively. In this workspace, you can take turns making edits with your teammates. To start editing, simply press the “edit” button. When you are finished, press the “stop” button to allow others to make their changes.

Reminder: Only one person can edit the code at a time; when another group member is editing, you will not be able to make changes.

Submit your code

When you have completed your work, you can submit it to your teachers. To do so, click the “submit” button. A pop-up window will appear; click “confirm” to finalize your submission.

Reminder: During a coding task, your teacher can monitor your work and track your progress, even if you have not yet submitted your answer.

View previously saved/submitted work through history

The history function enables students to review their previously submitted work or access automatically saved versions of their progress. If you accidentally delete your coding work, you can restore it through the history feature, preventing the need to start from scratch.

To access your work history, press the “history” button in the top right corner. This interface displays records of both your submitted and automatically saved work. 

There are three menus at the top of the page that allow you to filter your history:

  1. Select a task
  2. Choose a mode: either “All” (which includes both auto-saved and submitted work) or “Submission Only.”
  3. Select a specific save record by its date and time

This feature ensures that you can easily recover lost progress and maintain continuity in your work.

Reminder: You can submit your work multiple times, and each submission will be recorded with a different timestamp.

Share your code [TBC]

After you submit your work, you can choose to share your code with someone in the same virtual classroom, within the same school, or with everyone. Follow these steps to share your submission:

  1. After submitting your code, click “History” and then “Share” in the top right corner. A window will pop up.
  2. Edit the project name if necessary.
  3. Select the audience you wish to share your submission with.
  4. Press “Generate Link” to create a sharing link, then click “Copy Link” to copy the generated link.
  5. When the link is successfully copied, the word “Copied” will appear next to the button.
  6. Press “Done.”
  7. Paste the copied link wherever you wish to share it.

This feature allows you to easily share your work with others, facilitating collaboration and feedback.

Test your program with the micro:bit simulator

Just like the original MakeCode, even if you don’t have a physical micro:bit device, you can use the Micro:bit simulator on Una to run and test your program directly in your browser. This simulator allows you to emulate how the micro:bit would operate with your code, including user interactions and specific artificial data.

Here are the buttons and their descriptions:

  1. Start/Stop the simulator: Begin or halt the simulation.
  2. Restart the simulator: Reset the simulation to its initial state.
  3. Toggle debug mode: Enable or disable debugging features.
  4. Mute/Unmute: Control the sound output of the simulator.
  5. Full-screen mode: Expand the simulator to full-screen view.
Una Micro:bit simulator

Download Hex files to your computer

Just like the original MakeCode, you can follow these steps to download your code onto your computer:

  1. Press the “Download” button located in the lower left corner of your coding space.
  2. Once the download is complete, a window will appear as a reminder. If the download is successful, click “Done.” If the download was not successful, click “Download Again.”
Una Downloading Hex files 1
Una Downloading Hex files 2

Import Hex files to Micro:bit

You can import Hex files to your Micro:bit from your computer’s storage. Follow these steps:

  1. Insert the Micro:bit into your computer.
  2. Locate the Hex file you wish to import.
  3. Drag and drop the file onto the Micro:bit drive. Wait for the system to process the file.

Once the import is successful, the Micro:bit will automatically start executing the program you have loaded.

Una Importing hex files to Micro:bit

Upload Hex files to Una

  1. Locate the file you wish to import.
  2. Drag and drop the file onto the coding space. Wait for the system to process the file. Once the import is successful, you will see the coding space update accordingly.
Una Importing hex files to Una Platform

Use Extensions blocks

Just like the original MakeCode, Una’s MakeCode allows you to expand the functionality of your code. Follow these steps to add micro:bit’s extension blocks to your project:

  1. Click on “Advanced.”
  2. Scroll down and select “Extensions.”
  3. Enter the name of the extension in the search bar and select it from the results.
  4. The chosen extension will now appear in your coding blocks menu.
Una Using Extensions blocks 1
Una Using Extensions blocks 2

This will enable you to use additional features and tools in your code.

Remarks: When teachers include sample code with micro:bit extension blocks for a task, those extension blocks will automatically appear in each student’s coding workspace upon entering the task.

Switch between Blocks, JavaScript, and Python

You can easily switch the language in which your code is displayed. Supported languages include Blocks, JavaScript, and Python. To change the coding language, simply click the buttons located in the lower right corner of your coding space: “Blocks”, “JavaScript”, or “Python”. Pressing these buttons will switch your code to the respective language.

Una Switching between blocks, JavaScript, and Python 1
Una Switching between blocks, JavaScript, and Python 2

Common Issues

  1. Why do I encounter an error page when importing Hex files into the Una Platform?
  2. Why do some blocks disappear when I paste sample code that includes extension blocks?

Table of Content