Skip to content

Instantly share code, notes, and snippets.

@apla
apla / js#PacketSender.js
Last active August 29, 2015 13:56
sending packets of data
var PacketSender = function (url, options) {
this.data = [];
this.url = url;
options = options || {};
if (!options.maxPacketsToSend)
options.maxPacketsToSend = 100;
if (!options.timeout)
options.timeout = 60000;
this.o = options;
this.queuedPackets = {};
{
"name": "test",
"description": "test for component v1.0.0",
"private": true,
"version": "0.94.0",
"dependencies": {
"apla/dataflo.ws": "*",
"ftlabs/fastclick": "*",
"apla/EventEmitter": "*",
"apla/node-util": "*",
@apla
apla / .dataflows|example.json
Created May 27, 2014 08:47
dataflows example
[{
"path": "post",
"tasks": [{}]
}, {
"path": "upload"
}, {
"path": "presenters",
"flows": [{
"path": "json",
"data": {
@apla
apla / boards.txt
Last active August 29, 2015 14:12
msp430 arduino 1.5 support
# See: http://code.google.com/p/arduino/wiki/Platforms
menu.cpu=Processor
##############################################################
wizzi.name=wizzimote w/ cc430f5137
wizzi.build.core=wizzimote
wizzi.upload.tool=tilib_wizzi
wizzi.upload.protocol=tilib_wizzi
wizzi.upload.maximum_size=31104
@apla
apla / Arduino.h
Last active August 29, 2015 14:13
arduino project static analyze using node-libclang
/*
Arduino.h - Main include file for the Arduino SDK
Copyright (c) 2005-2013 Arduino Team. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
@apla
apla / cuwire.json
Last active August 29, 2015 14:14
my cuwire preferences
{
"arduino": "/Applications/devel/Arduino.app",
"sketch": {
"vccavr": {
"folder": "/Users/apla/work/mcu/brackets-cuwire/samples/ArduinoVoltage",
"platform": "arduino:avr",
"board": "pro",
"model": {
"cpu": "16MHzatmega328"
},
@apla
apla / cli.js
Created February 6, 2015 09:54
#!/usr/bin/env node
var ArduinoData = require ('cuwire/data');
var ArduinoCompiler = require ('cuwire/compiler');
var ArduinoUploader = require ('cuwire/uploader');
var CuwireSerial = require ('cuwire/serial');
var argv = require ('yargs').argv;
var fs = require ('fs');
@apla
apla / platform.txt
Created February 13, 2015 16:53
stellaris launchpads for cuwire and Arduino IDE 1.6.0
# from: https://groups.google.com/a/arduino.cc/forum/#!topic/developers/ZwxNPJHccQI
# LM4F test.
# ------------------------------
# For more info:
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification
name=Stellaris Launchpads
version=1.6.0
@apla
apla / main_ADC.c
Last active August 29, 2015 14:15 — forked from nicholasjconn/main_ADC.c
/******************************************************************************
* MSP430 ADC10 Example for the G2231
*
* Description: This code provides an example for using the 10 bit ADC in the
* MSP430G2231. The code requires either a terminal program or
* the application provided on the blog mentioned below.
* depending on which ascii character is sent to the device,
* either VCC, the temperature sensor, or an external pin will
* be measured once and the results sent to the computer.
*

NOTE: this example require platform API with promise support (Promise, WinJS.Promise or $.defered)

  1. Open Inspector
  2. Paste test-app-preferences.js into Console
  3. Run fetchIncrementStore ("test-run-count") from Console

Value must increment regardless application restart