microbit | A Rust crate for BBC micro : bit development

 by   nrf-rs Rust Version: v0.13.0 License: 0BSD

kandi X-RAY | microbit Summary

kandi X-RAY | microbit Summary

microbit is a Rust library typically used in Embedded System applications. microbit has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

microbit contains everything required to get started using Rust to create firmwares for the fabulous BBC micro:bit microcontroller board. This little board has everything and a kitchen sink built-in, even a capable debugging interface.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              microbit has a low active ecosystem.
              It has 169 star(s) with 45 fork(s). There are 11 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 9 open issues and 23 have been closed. On average issues are closed in 183 days. There are 2 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of microbit is v0.13.0

            kandi-Quality Quality

              microbit has no bugs reported.

            kandi-Security Security

              microbit has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              microbit is licensed under the 0BSD License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              microbit releases are not available. You will need to build from source code and install.
              Installation instructions, examples and code snippets are available.

            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 microbit
            Get all kandi verified functions for this library.

            microbit Key Features

            No Key Features are available at this moment for microbit.

            microbit Examples and Code Snippets

            No Code Snippets are available at this moment for microbit.

            Community Discussions

            QUESTION

            Why am I getting a TypeError: 'int' object not callable in a micro:bit MicroPython program?
            Asked 2021-Jun-05 at 09:07

            I was trying to make some kind of Boxel Rebound game for the micro:bit, and I was coding at the online web editor. It all worked fine, until I tried to implement the jumping. When I start the program, it works fine, and I get my debugging messages in the REPL:

            ...

            ANSWER

            Answered 2021-Jun-05 at 09:01

            Your Player Object has both an attribute and a method called jump (in your __init__ you have self.jump = 0). This is what your player.jump() is using (while you expect it to use the method) and you obviously cannot call an int as a method.

            Change the name of one of the two (attribute or method) and it should work.

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

            QUESTION

            microbit why blinking leds is so slow?
            Asked 2021-May-09 at 13:19

            Using this basic example code from microbit, blinking heart, I tried to change the delay of blinking with the pause argument. However, the minimum actual blinking frequency is around 500ms, no matter what value i put.

            Do you know why, and how I can achieve much faster blinking with led patterns (like show_icon or show_leds function).

            ...

            ANSWER

            Answered 2021-May-08 at 16:41

            You have tagged this as micropython but I don't believe that is what you are using. I think you are running with the Python in the MakeCode editor.

            Looking at the help page for for the MakeCode show_icon, it says it is called with:

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

            QUESTION

            What microcontrollers don't require a USB to UART driver to interface with computer?
            Asked 2021-Mar-22 at 09:43

            I am currently teaching a remote middle school summer camp next year that involves microcontroller programming. I’ve chosen to avoid Arduino microcontrollers for the camp and use a MicroPython compatible microcontroller instead. One microcontroller that I am interested in using is the Lolin V 1.1.0 with an ESP-Wroom-32 chip since it is cheap and reliable.

            One downside that I’ve noticed with this MCU is that a VCP driver needs to be installed in order to establish a USB to UART connection (It contains a CP210x chip). I’m not too sure how many Operating systems have a VCP driver installed by default. However, I tested to see if the microcontroller was able to be registered on three of my different laptops. On two MacBook airs, my computer was successfully able to locate the MCU without a virtual driver installed. Similarly, I used a Windows computer and a connection was able to be established after 10 minutes (Not sure why it took this long). Finally, I tried it on my friend’s European MacBook and his computer wasn’t able to locate the microcontroller until I installed the driver.

            I’m expecting that the camp would be ~300 students and I don’t want anyone to not be able to connect with their Microcontrollers and don’t want to include the installation of the driver since it can be tedious.

            Does anyone know how big companies that teach Microcontroller programming to beginners such as MicroBit, Raspberry Pi, or Arduino deal with this problem? How do they ensure that the microcontrollers are read by the computer without having to have students to go through the tedious process of installing a driver?

            What percentage of Operating systems have a CP210x VCP driver already installed?

            Are there any microcontrollers that don’t require a USB to UART driver installation altogether?

            Thanks! Ryan

            ...

            ANSWER

            Answered 2021-Mar-22 at 07:00

            The only one I am aware of that is pre-installed in windows is microchip PIC (eg PIC16F1454) but a PIC is not the best device for teaching. You have to run an application on the device to use USB VID:PID 04D8:000A.

            I don't have a machine to test it but maybe a microchip MCP2200 (04D8:00DF) will be the same.

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

            QUESTION

            Is this the correct way to write a MicroPython module that works across different builds?
            Asked 2021-Mar-13 at 23:35

            I'm writing a module for an I2C temperature sensor (TMP117) with cross-compatability being a priority.

            The MicroPython implementation is different on BBC Micro:bit and Raspberry Pi Pico - an important difference is how the I2C driver is implemented:

            • Pico uses the machine class to drive i2c: i2c.writeto
            • Micro:bit has already defined i2c.write (bundled with from microbit import *) docs

            This simple difference in naming is really all that affects compatability!

            So far I have shoehorned a working solution so my module tmp117.py is usable on both platforms. In tmp117.py, when the sensor class is initialised it checks the sysname and declares function pointers self.i2cWrite and self.i2cRead that are assigned the hardware-appropriate definition.

            However, I'm quite new to Python and imagine I may have committed many atrocities in doing so by eg. mishandling namespaces or chewing up memory with inappropriate imports. Can anybody comment if this method is appropriate? In terms of scalability, needless imports, namespaces etc.

            main.py

            ...

            ANSWER

            Answered 2021-Mar-13 at 23:35

            my choice of doing the same thing would be define _PLATFORM variable, set it accordingly and use it later:

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

            QUESTION

            Ada for I2C on the BBC Micro:Bit with the MCP23017
            Asked 2021-Feb-22 at 11:31

            I am trying to set up a very simple example using the ada I2C library with the MCP23017 IO expander on the micro:bit (V1.5) but I can't figure it out. For now, all I want to do is turn on an LED that is connected to a GPIOA pin. I have it working in python with the following:

            ...

            ANSWER

            Answered 2021-Feb-20 at 19:49

            I had an MCP23017 in 2012; can’t find it, so hard to help other than by suggesting lines of approach.

            Have you tied the three settable address lines in the datasheet Fig 3.6 (pins 15, 16, 17 in the diagram on the first page) to ground?

            You don’t check that the returned Status from the Master_Transmit calls is HAL.I2C.Ok.

            Looking at line 135 of nrf-twi.adb

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

            QUESTION

            Ada on the microbit: scrolling text example not working, no libusb library found
            Asked 2021-Jan-28 at 23:39

            I followed the adacore tutorial on displaying scrolling text (https://blog.adacore.com/ada-for-microbit-part-1-getting-started) but can't get it working on my microbit.

            Maybe my microbit is a more recent version that is not yet supported? The reason I suspect this is that my board id (9904) was not supported the first time I tried to flash to the board. I used the fix described here: Unable to get the Ada scrolling text demo working on the microbit on GNAT 2019 community edition and added the following line in board_ids.py:

            ...

            ANSWER

            Answered 2021-Jan-23 at 14:12

            libusb is missing or not found on your computer. It is used to communicate with the Microbit board to upload/debug.

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

            QUESTION

            Problems with Micropython command time_pulse_us on Microbit
            Asked 2021-Jan-12 at 13:00

            I would like to ask some help from you. I'm trying to connect a distance sensor to my microbit but when I use the command "time_pulse_us" it always gives -2 or -1. I read the documentation, I understand the meaning of those numbers but I think there's a problem with the command or probably I'm using it the wrong way.

            In that regard, I wrote a simple snippet to test the command. Could you tell me what's wrong with it?

            ...

            ANSWER

            Answered 2021-Jan-12 at 13:00

            time_pulse_us() runs sequentially, not in the background, so at the call it will wait 1 second for the pin to reach 1, which it will not do, hence time will be set to -2, before the program goes on to the next command write_digital(1).

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

            QUESTION

            Microbit music / scroll output corrupting memory?
            Asked 2021-Jan-02 at 16:12

            My son and I are trying to implement one of the fun-science.org microbit tutorials - building a "tug of war" game. Essentially, 10 presses on button A moves the sprite closer to that button and the same applies on button B. When you hit the edge of the screen, music plays and a message is scrolled on the screen before the game restarts.

            We've got it fully working, but once the game has been won, it doesn't seem to reset properly. It works fine on the simulator, but not on the physical device (a microbit 2).

            Once the game is won, the behaviour is erratic. It usually puts the sprite back in the middle, sometimes not, but frequently, one button doesn't work in the next game. Occasionally both stop working. In every situation, a restart fixes things.

            Is there something wrong with the code? I've wondered whether the music / message is corrupting something and I need to put a wait in for it to complete. I've re-downloaded the hex file and re-flashed the microbit several times, so I think I've eliminated a corrupt code file.

            Javascript version of code shown below, but it was actually built in blockly using the Microsoft MakeCode tool.

            ...

            ANSWER

            Answered 2021-Jan-02 at 16:12

            I found it was more reliable if I did game.pause() and game.resume() while scrolling the text and playing the music at the end of the game:

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

            QUESTION

            Is there any way to find the five character ID of the micro:bit in micropython?
            Asked 2020-Oct-23 at 21:44

            this is how we get the device name using blocks But I need to find the way to code in micropython to find the same.

            from microbit import * while True: basic.show_string(control.device_name())

            This throws an error!

            ...

            ANSWER

            Answered 2020-Oct-23 at 21:44

            micropython for the micro:bit is different from the code used in the MakeCode editor.

            They are both based on Hardware Abstraction Layer defined at the following location: https://lancaster-university.github.io/microbit-docs/concepts/

            The documentation for micropython is available at: https://microbit-micropython.readthedocs.io/en/v1.0.1/microbit_micropython_api.html

            There is not a unique name in the same way that there is in blocks.

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

            QUESTION

            How can I access the light sensor value when using bbc:microbit over bluetooth?
            Asked 2020-Sep-12 at 21:07

            I am playing around with bbc:microbit using bluetooth web api to access the microbit service data (button event, led, magnetometer, ...).

            It looks like the light sensor information are not accessible from the javascript API. From the microbit documentation, light sensing are accessible from the led service, but it looks like the lib is missing them.

            ...

            ANSWER

            Answered 2020-Sep-12 at 21:07

            The micro:bit Bluetooth profile is defined at:

            https://lancaster-university.github.io/microbit-docs/resources/bluetooth/bluetooth_profile.html

            It does not expose the light sensor information by default over Bluetooth. My initial thought for a quick workaround is that you could send the value over the Bluetooth UART service. I used the editor at: https://makecode.microbit.org/#editor to create a hex file for the micro:bit that seemed to work:

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

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

            Vulnerabilities

            No vulnerabilities reported

            Install microbit

            All you need to start programming this device is:.
            A BBC micro:bit board
            A computer (macOS and Linux work perfectly, Windows tested as well)
            A bit of open source software
            The examples make use of some of the fantastic tooling from the knurling project. In order to run the examples you need to install probe-run and flip-link.

            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/nrf-rs/microbit.git

          • CLI

            gh repo clone nrf-rs/microbit

          • sshUrl

            git@github.com:nrf-rs/microbit.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