Elfshield Micropython Code Tutorial

Note: If you feel that the picture in the text is not clear enough, please click the picture first, enter the picture detail interface, 
and then click the picture to view the high-definition original picture.

Mu is a Python code editor for beginner programmers based on extensive feedback given by teachers and learners.

If you have ever tried to teach young people how to program, you will immediately grasp the importance of Mu. Most programming tools are
written by developers for developers and aren't well-suited for beginning programmers, regardless of their age. Mu, however, was written
by a teacher for students.

To try it out, download Mu and follow the easy installation instructions for Linux, Windows, and Mac OS.
You can download Mu with the link https://codewith.mu/en/download .
Installation steps in Windows: https://codewith.mu/en/howto/install_windows
Installation steps in MacOS: https://codewith.mu/en/howto/install_macos

You can refer to the link https://codewith.mu/en/tutorials/ , and then get some basic tutorials.

Note: If you feel that the picture in the text is not clear enough, please click the picture first, enter the picture detail
interface, and then click the picture to view the high-definition original picture.

After opening the Mu editor, to develop the micro:bit, click on the “Mode” option in the upper left corner of the software, then select
the “BBC micro:bit” mode as follows:

The interface after the mode selection is completed:

You can get more information with https://codewith.mu/en/tutorials/1.0/microbit.

Note: If you feel that the picture in the text is not clear enough, please click the picture first, enter the picture detail interface, 
and then click the picture to view the high-definition original picture.

After completing the previous work, you can't fully use the ELF shield to drive the WEEEMAKE electronic module. You need to do the following steps:

Step 1:Download file:wm_elfshield_firmware_latest_version.rar,then unzip and get a HEX file, the latest version of V1.3.

Step 2:Firmware configuration for micro:bit, input the full path and file name of the HEX file to the microbit setting, then you can use the
ELF shield board to drive the WEEEMAKE electronic module with python code.

The specific operation process is as follows:

Source code:

from elfshield import *
import time

while True:
    distance = int(ultrasonic_getDistance(PORT_A))
    digitalModule_showNumber(PORT_B,distance)
    time.sleep_ms(100)
    
 

Execution effect:

Detailed Elfshield board micropython API please refer to Elfshield Micropython API Reference