<commit_before>MicroFlo: flow-based programming for microcontrollers
========================================================
[![Build Status](https://travis-ci.org/jonnor/microflo.png?branch=master)](https://travis-ci.org/jonnor/microflo)

Implementation of [Flow-based programming](http://en.wikipedia.org/wiki/Flow-based_programming).
Inspired by and designed for integration with [NoFlo](http://noflojs.org/).
First hardware target will be [Arduino](http://arduino.cc)-compatible boards.

Different from most other physical computing involving Node/JavaScript in that it
aims to allow build _standalone_ microcontroller applications, that can also be reconfigured at runtime.

Status
-------
**Experimental**. Simple things work, but not tested thoroughly. Several things in the architecture has not been validated.
Suitable for interested hackers only, not for general consumption.

Can run simple applications defined by .fbp files,
like a fridge flow which reads out temperature using a DS1820 digital thermometer
and turns on/off the cooler to maintain desired temperature.

See [examples](./examples).

Milestones
-----------
* 0.1.5, "Introspectable": One can monitor graphs running on the device from host
* 0.2.0, "Runtime reconfigurable": Graphs can be changed on the fly
* 0.3.0, "Generally useful": Implements Firmata protocol, most of Arduino tutorials works

TODO
-----
    git grep -E 'TODO|FIXME|XXX|IDEA|PERF'


Using/developing
-----------------
Note: Only tested on Arch Linux and Ubuntu, but should work on any GNU/Linux.
May also work on Mac OSX. Windows not, as [Ino](http://inotool.org/#limitations) does not support it.

Note: Only tested with Arduino Uno R3 and Arduino Nano R3.

Get the code
    git clone https://github.com/jonnor/microflo.git
    cd microflo

Install prerequsites; Arduino and Ino
    apt-get install arduino
    pip install ino

To build and run tests
    make && make check

To flash your Arduino with a graph
    make upload GRAPH=examples/blink.fbp MODEL=uno

To see existing or add new components, check the files
    ./microflo/components.json
    ./microflo/components.cpp

When you find issues: file bugs and/or provide patches!

License
-------
MIT for the code in MicroFlo, see ./LICENSE.
Note that MicroFlo currently relies on the Arduino, DallasTemperature and OneWire libraries,
which are under the GNU LGPL.

Goals
----------
1. People should not need to understand text-based, C style programming to be able to program microcontrollers.
But those that do know it should be able to use that knowledge, and be able to mix-and-match it
with higher-level paradims within a single program.
2. It should be possible to verify correctness of a microcontroller program in an automated way,
and ideally in a hardware-independent manner.
3. It should be possible to visually debug microcontroller programs.
4. Microcontroller functionality should be reprogrammable on the fly.
5. Microcontrollers should easily integrate into and with higher-level systems:
other microcontrollers, host computers, and the Internet.
6. Microcontroller programs should be portable between different uC models and uC architectures.

Design
------
* Run on 8bit+ uCs with 32kB+ program memory and 1kB+ RAM
    * Primarily as bare-metal, but embedded Linux also possible in future
    * For initial component implementations, wrap Arduino/LUFA/etc
    * Components that are not tied to a particular I/O system shall have host-equivalents possible
* Take .fbp/.json flow definition files used by NoFlo as the canonical end-user input
    * Use NoFlo code to convert this to a more compact and easy-to-parse binary format, architecture-independent flow representation
    * Flows in binary format can be baked into the firmware image.<commit_msg>Fix README formatting<commit_after>MicroFlo: flow-based programming for microcontrollers
========================================================
[![Build Status](https://travis-ci.org/jonnor/microflo.png?branch=master)](https://travis-ci.org/jonnor/microflo)

Implementation of [Flow-based programming](http://en.wikipedia.org/wiki/Flow-based_programming).
Inspired by and designed for integration with [NoFlo](http://noflojs.org/).
First hardware target will be [Arduino](http://arduino.cc)-compatible boards.

Different from most other physical computing involving Node/JavaScript in that it
aims to allow build _standalone_ microcontroller applications, that can also be reconfigured at runtime.

Status
-------
**Experimental**. Simple things work, but not tested thoroughly. Several things in the architecture has not been validated.
Suitable for interested hackers only, not for general consumption.

Can run simple applications defined by .fbp files,
like a fridge flow which reads out temperature using a DS1820 digital thermometer
and turns on/off the cooler to maintain desired temperature.

See [examples](./examples).

Milestones
-----------
* 0.1.5, "Introspectable": One can monitor graphs running on the device from host
* 0.2.0, "Runtime reconfigurable": Graphs can be changed on the fly
* 0.3.0, "Generally useful": Implements Firmata protocol, most of Arduino tutorials works

TODO
-----
    git grep -E 'TODO|FIXME|XXX|IDEA|PERF'


Using/developing
-----------------
Note: Only tested on Arch Linux and Ubuntu, but should work on any GNU/Linux.
May also work on Mac OSX. Windows not, as [Ino](http://inotool.org/#limitations) does not support it.

Note: Only tested with Arduino Uno R3 and Arduino Nano R3.

Get the code

    git clone https://github.com/jonnor/microflo.git
    cd microflo

Install prerequsites; Arduino and Ino

    apt-get install arduino
    pip install ino

To build and run tests

    make && make check

To flash your Arduino with a graph

    make upload GRAPH=examples/blink.fbp MODEL=uno

To see existing or add new components, check the files
    [./microflo/components.json](./microflo/components.json)
    [./microflo/components.cpp](./microflo/components.cpp)

When you find issues: file bugs and/or provide patches!

License
-------
MIT for the code in MicroFlo, see ./LICENSE.
Note that MicroFlo currently relies on the Arduino, DallasTemperature and OneWire libraries,
which are under the GNU LGPL.

Goals
----------
1. People should not need to understand text-based, C style programming to be able to program microcontrollers.
But those that do know it should be able to use that knowledge, and be able to mix-and-match it
with higher-level paradims within a single program.
2. It should be possible to verify correctness of a microcontroller program in an automated way,
and ideally in a hardware-independent manner.
3. It should be possible to visually debug microcontroller programs.
4. Microcontroller functionality should be reprogrammable on the fly.
5. Microcontrollers should easily integrate into and with higher-level systems:
other microcontrollers, host computers, and the Internet.
6. Microcontroller programs should be portable between different uC models and uC architectures.

Design
------
* Run on 8bit+ uCs with 32kB+ program memory and 1kB+ RAM
    * Primarily as bare-metal, but embedded Linux also possible in future
    * For initial component implementations, wrap Arduino/LUFA/etc
    * Components that are not tied to a particular I/O system shall have host-equivalents possible
* Take .fbp/.json flow definition files used by NoFlo as the canonical end-user input
    * Use NoFlo code to convert this to a more compact and easy-to-parse binary format, architecture-independent flow representation
    * Flows in binary format can be baked into the firmware image.
{'fraction_non_alphanumeric': 0.0918514630625902, 'fraction_numerical': 0.006560818790185015, 'mean_word_length': 4.064451827242525, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6998109', 'n_tokens_mistral': 2126, 'n_tokens_neox': 1966, 'n_words': 947}