Coder Social home page Coder Social logo

mbeddr.arduino's Introduction

mbeddr.arduino

Background

This is a DSL to write programs for the Arduino platform. It is based on the mbeddr project which is an extensible C implementation in JetBrains MPS.

Currently this project nothing but a playground if offers some really limited support for the Arduino Uno and is likely to change and break stuff so this nothing you want to put you work on right now.

Installation

Prerequisites

Obviously you will need a working MPS and mbeddr installation. You will need at least version 0.6-EAP.

You can also use mbeddrs windows installer to get mbeddr if you are using windows.

Setup

You will need the following tools installed on you machine and available in your path. These should be available for any platform, though I have only tested it on Mac and Linux

Linux

On most Linux distributions you will get all these when you install the following packages:

avr-binutils avrdude avr-gcc avr-libc

You might also want to install

avr-gdb

But currently there is no support for direct debugging out of mbeddr.arduino!

Mac

You need to have a working Mac Ports installation to get the needed libraries. Then you can use the following commands to install the needed programs and libraries:

sudo port install avr-libc avr-gdb avrdude

Windows

On Windows you need to install WinAVR. Please make sure that you check the "Add to PATH" option in the installer.

Get it

You can grab the latest release from the release page. The release contains two parts:

mbeddr extensions

These are plugins for mebddr / MPS that extend mebddr with support for the Arduino platform. Those mbeddr.arduino.core.zip file contains these. You need to put them in the plugins folder in your MPS or mbeddr installation.

Arduino support library

This is a tiny C library that is used by the generator to handle some common use cases and to improve the readability of the generated code. It is contained in the mbeddr.arduino.support.zip. You can put it some where on you hard disk where you can find it later on. Please remember that path where you put it, because you need to set it in the ArduinoConfiguration of your project.

Try it

Now open your favorite shell and navigate to solutions/arduino.samples/source_gen/arduino/samples/Blinker from the root of the source code.

You will find the generated source code from the sample here which you can build with a simple

make

This generates :

bin/main.o
arduino
arduino.hex

The arduino.hex is the interesting stuff since it the executable for the arduino. This can be flashed to a connected Arduino Uno via:

avrdude -F -V -c arduino -p ATMEGA328P -P /dev/ttyACM0 -b 115200 -U flash:w:arduino.hex

Now the Arduino will run a simple blinker sample the blinks the build in LED.

Build it

You can find the building instructions in the wiki

State

Currently this project only has bare minimum support for the Arduino Uno. It has some rough edges but it should be good to try it. To see what is missing have a look at the Issues.

For more information how stuff works have a look at the wiki which will contain a growing list of pages in the near future.

mbeddr.arduino's People

Contributors

bkolb avatar coolya avatar slisson 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.