======Elfshield Micropython Code Tutorial====== =====Chapter 1 Mu Python Editor===== 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. ====1.1 What's Mu?==== 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. {{:wm_wiki:mu.gif|}} ====1.2 Download an Install==== 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 {{:wm_wiki:mu_11.png?900|}} ====1.3 Using Mu==== You can refer to the link https://codewith.mu/en/tutorials/ , and then get some basic tutorials. =====Chapter 2 Mu and BBC micro:bit Mode===== 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. ====2.1 Mu Set Mode ==== 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: {{:wm_wiki:mu_12.png?900|}} The interface after the mode selection is completed: {{:wm_wiki:mu_13.png?900|}} ====2.2 Write Your Code with Python ==== You can get more information with https://codewith.mu/en/tutorials/1.0/microbit. =====Chapter 3 ELF shield for micro:bit ===== 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. ====3.1 How to use ELF shield support WEEEMAKE electronic module ==== 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_wiki: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: {{:wm_wiki:mu_14.png?900|}} ====3.2 An Example==== {{:wm_wiki:mu_15.png?900|}} 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: {{:wm_wiki:mu_03.gif|}} ==== 3.3 Detailed elfshield module micropython API ==== Detailed Elfshield board micropython API please refer to [[wm_wiki:elfshield_micropython_api_reference|Elfshield Micropython API Reference]]