Skip to content

Instantly share code, notes, and snippets.

@jonnor
Last active August 29, 2015 14:06
Show Gist options
  • Save jonnor/afa0dde1fe4e488a4447 to your computer and use it in GitHub Desktop.
Save jonnor/afa0dde1fe4e488a4447 to your computer and use it in GitHub Desktop.
MicroFlo command stream format (FBCS), annotated
// build/avr/firmware.cpp
#include <avr/pgmspace.h>
const unsigned char graph[] PROGMEM = {
0xa,0x0,0x0,0x0,0x0,0x0,0x0,0x0, // stop network, clear old graph
0xf,0x1,0x0,0x0,0x0,0x0,0x0,0x0, // configure debug level etc
0xb,0x7,0x0,0x0,0x0,0x0,0x0,0x0, // create node of component 0x7. This becomes node 0x1, next one 0x2 etc
0xb,0xb,0x0,0x0,0x0,0x0,0x0,0x0,
0xb,0x5,0x0,0x0,0x0,0x0,0x0,0x0,
0xc,0x1,0x2,0x0,0x0,0x0,0x0,0x0, // connect node 0x1, outport 0x0 to node 0x2, inport 0x0
0xc,0x2,0x3,0x0,0x0,0x0,0x0,0x0,
0xd,0x1,0x0,0x7,0x2c,0x1,0x0,0x0, // send an initial packet of type 0x7 (integer) with data 0x2c,0x1,0x0,0x0 to inport 0x0
0xd,0x3,0x1,0x7,0xd,0x0,0x0,0x0,
0x14,0x0,0x0,0x0,0x0,0x0,0x0,0x0 // start network
};
#define MICROFLO_EMBED_GRAPH
#include "microflo.h"
#include "main.hpp"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment