Code Monkey home page Code Monkey logo

punda's Introduction

punda: programming the micro:bit with Rust

Travis License

Punda provides a high level, easy to use interface for interacting with the BBC micro:bit, a small, handheld micro-controller designed for teaching and learning computer science, using the Rust Programming Language.

The intention of punda is to complement the other development environments already available for the micro:bit: the Javascript Blocks editor and MicroPython. Specifically, punda brings Rust's static typing, ergonomics, and functional constructs to the table. In addition to being useful for teaching programming to those unfamiliar, punda is also a good way to learn Rust: two equivalent micro:bit programs can be compared across Javascript, Blocks, Python, and Rust to highlight the similarities and differences between each.

For examples of using the punda crate, check the examples/ directory in this repository. With the correct development environment set up, any example can be run on the micro:bit with cargo run --example [name].

Under construction

Note that this crate's documentation, API, and entire design is still up for determination. As a hobby project, I don't have as much time to work on it as I wish I could.

Development dependencies

To develop applications using this library, the following tools must be installed:

  • rustup, Rust's toolchain manager
  • gdb-arm-none-eabi, a build of gdb compatible with the micro:bit
  • OpenOCD, a program to communicate with and flash the micro:bit

When the above tools are installed, perform the following setup to start a new binary crate (application) using easy_microbit.

First, install the nightly Rust toolchain.

> rustup install nightly-2018-09-27

Next, install the thumbv6m-none-eabi Rust target.

> rustup target add thumbv6m-none-eabi

Create a new Rust crate.

> cargo new --bin microbit_example

punda's People

Contributors

cgm616 avatar dependabot-preview[bot] avatar dependabot-support avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

anglerud bludotz

punda's Issues

Fix up user resources

User functions should not need to worry about mutexes, and user functions should preferably not need a Context variable. User button handlers should also be able to delay as long as needed.

All this is to say that user code probably all needs to be run on the same level. However, a common pattern is to delay in the idle thread while waiting for a button press, etc. We need to find a way to manage user tasks, per se. When a user task delays, it should literally yield to the task manager. Can we use generators here?

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.