micropython | Port of MicroPython for the BBC micro : bit

 by   bbcmicrobit C Version: v1.0.1 License: Non-SPDX

kandi X-RAY | micropython Summary

kandi X-RAY | micropython Summary

micropython is a C library typically used in Internet of Things (IoT) applications. micropython has no bugs, it has no vulnerabilities and it has low support. However micropython has a Non-SPDX License. You can download it from GitHub.

This is the source code for MicroPython running on the BBC micro:bit!. To get involved with the micro:bit community join the Slack channel by signing up here: Various things are in this repository, including: - Source code in source/ and inc/ directories. - Example Python programs in the examples/ directory. - Tools in the tools/ directory. The source code is a yotta application and needs yotta to build, along with an ARM compiler toolchain (eg arm-none-eabi-gcc and friends).
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              micropython has a low active ecosystem.
              It has 516 star(s) with 275 fork(s). There are 66 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 104 open issues and 267 have been closed. On average issues are closed in 481 days. There are 22 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of micropython is v1.0.1

            kandi-Quality Quality

              micropython has 0 bugs and 0 code smells.

            kandi-Security Security

              micropython has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              micropython code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              micropython has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              micropython releases are available to install and integrate.
              Installation instructions are not available. Examples and code snippets are available.
              It has 2332 lines of code, 148 functions and 48 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of micropython
            Get all kandi verified functions for this library.

            micropython Key Features

            No Key Features are available at this moment for micropython.

            micropython Examples and Code Snippets

            No Code Snippets are available at this moment for micropython.

            Community Discussions

            QUESTION

            How to retrieve and format wifi MAC address in MicroPython on ESP32?
            Asked 2022-Apr-17 at 15:02

            I have the following MicroPython code running on an ESP32:

            ...

            ANSWER

            Answered 2022-Apr-17 at 15:02

            I am also a little suspicious of the bytes retrieved from wlan_sta.config('mac'). I would have expected something that looked more like b'\xaa\xbb\xcc\x11\x22\x33' instead of b'0\xae\xa4z\xa7$'. The z and the $ seem very out of place for something that should be hexadecimal and it seems too short for what should be six pairs of digits.

            You're not getting back a hexadecimal string, you're getting a byte string. So if the MAC address contains the value 7A, then the byte string will contain z (which has ASCII value 122 (hex 7A)).

            Am I using the correct method to get the MAC address?

            You are!

            If it is correct, how can I format it as six pairs of hex digits?

            If you want to print the MAC address as a hex string, you can use the ubinascii.hexlify method:

            Source https://stackoverflow.com/questions/71902740

            QUESTION

            micropython and sys.implementation- different on XIAO SAMD21 and XIAO RP2040
            Asked 2022-Mar-27 at 18:05

            I was working with micropython on a SEEED XIAO (SAMD21) using version 1.18, and wanted to use 'compiled' libraries (.mpy) to conserve space. I had mpy-cross for version 5 which worked okay for me. I also wanted to have floating point so I built a new micropython with that option- from the latest (20220302) github version- and noticed that mpy-cross had updated to version 6. I thought I would check to see which versions of .mpy were used The micropython documentation suggests some code to check the version of .mpy using the sys.implementation object. I noticed a variety of sys.implementation implementations.

            Version 1.18- released by micropython 20220117 on the XIAO SAMD21 gave the following results:

            ...

            ANSWER

            Answered 2022-Mar-27 at 18:05

            If you want to use precompiled/bytecode .mpy files then you will need to Decide to use either bytecode or compile to native code for your mcu platforms.

            For bytecode you will need to distribute a bytecode version that matches the runtime firmware, 1.12-1.18 == 5, next version will increase

            For native code you'll need to distribute versions for each platform that you want to support. An esp32c3 cannot run stm32 native code and vice-versa

            Also the different ports/board will indeed have differences in some of the stdlib APIs. Your code must be robust enough to handle these differences.

            Source https://stackoverflow.com/questions/71330735

            QUESTION

            How to send the contents of a variable to Micropython repl
            Asked 2022-Mar-06 at 21:19

            I am trying to create a file in an ESP32 named "PassWord" containing a password, using Micropython Serial. The code below works with a "hardwired" password, but I would like to be able to send the contents of a variable that was typed in by the user. The sending script is running in Win10 using Python 3.7.9

            ...

            ANSWER

            Answered 2022-Mar-06 at 21:19

            You could do something like this. Just made this as an exaggerated example so you can learn. You could put this whole thing into the send function input if you wanted.

            Source https://stackoverflow.com/questions/71365971

            QUESTION

            Change url of a webpage on a local network
            Asked 2022-Mar-01 at 08:57

            I built a webpage on an ESP32 chip, charged to create an access point allowing my computer to connect in order to access this page.
            For the moment I can only access it using the IP of my ESP by typing it in a browser but it can be very bothersome.
            I'd like to know if it was possible to change the url of the page using words instead of the ESP's IP.
            Maybe I'm missing some technical terms but I didn't find any solution on the internet.

            PS: I'm using micropython with sockets to serve html files from the board:

            ...

            ANSWER

            Answered 2022-Feb-26 at 19:31

            Certainly. The easiest option is enabling mDNS. This allows hosts in the same local network to resolve the device's name (e.g. espressif.local) into its IP. Only works in local network and requires an mDNS client on the computer (Mac, Linux and Windows all tend to have it built in these days).

            No idea how to do it in Micropython, though. Give Google a try.

            Source https://stackoverflow.com/questions/71276214

            QUESTION

            SPDT Switches with a Raspberry Pi Pico
            Asked 2022-Feb-23 at 12:37

            Basically I'm just trying to figure out how an spdt switch would work with a raspberry pi pico. When I search for information on how to interface a switch with a pico, all I get is info on button switches.

            Does the spdt switch act like a closed circuit, constantly providing power to the pin I connect it to?

            Assuming the answer to the question above is "yes", how would I go about telling micropython to do different things based on which pin is receiving power?

            Sorry for the simple questions, I have no experience in the domain of microcontrollers and can't find this info anywhere.

            ...

            ANSWER

            Answered 2022-Feb-23 at 12:37

            A switch -- by itself -- doesn't provide power to anything. All it does is close and open a circuit. You can replace the switch with a wire and connect/disconnect the wire and accomplish the same thing.

            If you had the middle pin of the switch connected to GPIO 2, and the two outer pins wire to Ground and Vcc, you could use the switch to switch the value of the GPIO between logic 0 and logic 1.

            Reading the value would look something like this:

            Source https://stackoverflow.com/questions/71230625

            QUESTION

            Is it possible to wait for either button A or button B?
            Asked 2022-Feb-11 at 15:27

            This is code that waits for an event coming from button A.

            control.waitForEvent(Button.A, EventBusValue.MICROBIT_EVT_ANY)

            I want to wait for either button A OR button B to be pressed.

            Is this possible?

            EDIT

            I know that in Scratch this is possible with something like button.any, also the above code is written in microjavascript, but it is written similarly in micropython, so maybe someone from this field can also help. Thank you.

            ...

            ANSWER

            Answered 2021-Dec-28 at 20:08

            Have a look at the python code generated using the 'on event from' block in https://makecode.microbit.org. This block can be found under the Advanced tab. The block can be set to wait for either button A or B to be pressed. The micropython code generated in this case is:

            Source https://stackoverflow.com/questions/70424520

            QUESTION

            No such file or directory: 'arm-none-eabi-gcc' error trying to make micropython for STM32
            Asked 2022-Feb-09 at 13:39

            I am following the documentation for building micropython

            ...

            ANSWER

            Answered 2022-Feb-09 at 12:32

            For some reason the installer did not put the binaries in my path. I fixed this with

            Source https://stackoverflow.com/questions/71047549

            QUESTION

            How to iterate through files in a folder using MicroPython?
            Asked 2022-Feb-02 at 21:34

            I'm trying to read all files with .asm and .py extensions in an sd card using MicroPython.

            I checked the answers in this question but they don't work with MicroPython.

            MicroPython doesn't have glob nor pathlib and when using os library and try this code:

            ...

            ANSWER

            Answered 2022-Feb-02 at 14:08

            your on the right track, os.listdir works just fine on any version of MicroPython, but does not recurse the sub-folders.

            so you need to distinguish a folder from a filenode as in the below.

            Source https://stackoverflow.com/questions/70946767

            QUESTION

            Can't install Micropython module through upip, error message is not clear
            Asked 2022-Feb-02 at 15:49

            I'm trying to work with the Tronpy module in Micropython. It works fine when I'm using CPython. However, in Micropython, I tried to install it and got an error message. I'm using Fedora 34.

            ...

            ANSWER

            Answered 2022-Feb-02 at 15:49

            It appears that you are attempting to upip install a CPython module on MicroPython. (sorry , could have seen that sooner)

            That will not work - unless that module is packaged specifically for MicroPython.

            The error message could be clearer though...

            I would suggest searching PyPi for MicroPython specific packages, either through the micropython- prefix or using the programming language filter:

            lastly: in upip you can enable some debug messages by setting upip.debug = True as in the below sample

            Source https://stackoverflow.com/questions/70934653

            QUESTION

            esp32 micropython littlefs
            Asked 2022-Jan-31 at 22:27

            Using a Expressif dev-board and standard micropython.bin I was able to create a littlefs2 partition, mount it and write data into a file:

            ...

            ANSWER

            Answered 2022-Jan-31 at 22:27
            A - Revert to fat

            if reformat with vfsFat is close enough to 'getting rid of' you can do the following:

            Source https://stackoverflow.com/questions/70783552

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install micropython

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/bbcmicrobit/micropython.git

          • CLI

            gh repo clone bbcmicrobit/micropython

          • sshUrl

            git@github.com:bbcmicrobit/micropython.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link