Giter Site home page Giter Site logo

swapnil-11-04-01 / microbit-v2-samples Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lancaster-university/microbit-v2-samples

1.0 0.0 0.0 830 KB

CODAL build tools and sample programs for the micro:bit v2.x

License: MIT License

JavaScript 1.32% C++ 52.12% Python 31.64% C 0.91% CMake 13.79% Dockerfile 0.22%

microbit-v2-samples's Introduction

microbit-v2-samples

Native Build Status Docker Build Status

This repository is provides the tooling needed to compile a C/C++ CODAL program for the micro:bit v2 and produce a HEX file that can be downloaded to the device.

Raising Issues

Any issues regarding the micro:bit are gathered on the lancaster-university/codal-microbit-v2 repository. Please raise yours there too.

Installation

You need some open source pre-requisites to build this repo. You can either install these tools yourself, or use the docker image provided below.

We use Ubuntu Linux for most of our tests. You can also install these tools easily through the package manager:

    sudo apt install gcc
    sudo apt install git
    sudo apt install cmake
    sudo apt install gcc-arm-none-eabi binutils-arm-none-eabi

Yotta

For backwards compatibility with microbit-samples users, we also provide a yotta target for this repository.

Docker

You can use the Dockerfile provided to build the samples, or your own project sources, without installing additional dependencies.

Run the following command to build the image locally; the .bin and .hex files from a successful compile will be placed in a new out/ directory:

    docker build -t microbit-tools --output out .

To omit the final output stage (for CI, for example) run without the --output arguments:

    docker build -t microbit-tools .

Building

  • Clone this repository
  • In the root of this repository type python build.py
  • The hex file will be built MICROBIT.HEX and placed in the root folder.

Developing

You will find a simple main.cpp in the source folder which you can edit. CODAL will also compile any other C/C++ header files our source files with the extension .h .c .cpp it finds in the source folder.

The samples folder contains a number of simple sample programs that utilise you may find useful.

Debugging

If you are using Visual Studio Code, there is a working debugging environment already set up for you, allowing you to set breakpoints and observe the micro:bit's memory. To get it working, follow these steps:

  1. Install either OpenOCD or PyOCD.
  2. Install the marus25.cortex-debug VS Code extension.
  3. Build your program.
  4. Click the Run and Debug option in the toolbar.
  5. Two debugging options are provided: one for OpenOCD, and one for PyOCD. Select the correct one depending on the debugger you installed.

This should launch the debugging environment for you. To set breakpoints, you can click to the left of the line number of where you want to stop.

Compatibility

This repository is designed to follow the principles and APIs developed for the first version of the micro:bit. We have also included a compatibility layer so that the vast majority of C/C++ programs built using microbit-dal will operate with few changes.

Documentation

API documentation is embedded in the code using doxygen. We will produce integrated web-based documentation soon.

microbit-v2-samples's People

Contributors

jamesadevine avatar finneyj avatar mmoskal avatar johnvidler avatar microbit-carlos avatar jaustin avatar raphaelgault avatar microbit-matt-hillsdon avatar martinwork avatar carlosperate avatar microbit-sam avatar tballmsft avatar rneacy avatar pelikhan avatar kant avatar nedseb avatar incognitojam avatar ridajichi avatar

Stargazers

Swapnil Sharma avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.